[R] Generic distributions

2007-03-06 Thread Alberto Monteiro
Is there any class that generalizes distributions? For example, I could say x - generic_distribution(normal, list(mean=1, sigma=0.5)) and then use it like rgeneric_distribution(100, x) to get a sample of 100, or pgeneric_distribution(0.5, x) to get the pdf at (x = 0.5). In the openbugs/winbugs

[R] Subseting data frame based on column names

2007-03-06 Thread Li, Aiguo \(NIH/NCI\) [C]
Hello all, I have a data frame containing 170 columns and would like to generate a new data frame containing all rows but only 67 columns selected according to column names. How can I do this? Thanks in advance, AG Lee [[alternative HTML version deleted]]

Re: [R] R and SAS proc format

2007-03-06 Thread John Kane
--- lamack lamack [EMAIL PROTECTED] wrote: Dear all, Is there an R equivalent to SAS's proc format? What does the SAS PROC FORMAT do? __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] R and SAS proc format

2007-03-06 Thread Frank E Harrell Jr
Ulrike Grömping wrote: The down side to R's factor solution: The numerical values of factors are always 1 to number of levels. Thus, it can be tough and requires great care to work with studies that have both numerical values different from this and value labels. This situation is currently

[R] Recalling and printing multiple graphs. Is there something in the HISTORY menu that will help?

2007-03-06 Thread John Sorkin
I am re-sending this Email message as it does not appear to have been received my the R mail list Daemon. My apologies of you receive two copies of this message. If you do, it will mean that the first message finally made it through cyberspace to the list server. I have written an R function

Re: [R] optim(), nlminb() and starting values

2007-03-06 Thread Gabor Grothendieck
If your problem is small enough just use a grid of starting values and run your optimization on each one and then take the best. On 3/6/07, Dae-Jin Lee [EMAIL PROTECTED] wrote: Hi all ! I've been trying to maximize a likelihood using optim( ) function, but it seems that the function has

[R] Obtaining figures with exactly placed points

2007-03-06 Thread Scionforbai
Dear list, I have to plot some geometrical shape given as list of points. My need is the following: let's say my shape is a 1 inch large square; how can I plot it with R in a graphic format that gives me an image *exactly* 1 inch large? I tried to set oma, mar and fin parameters, but with no

Re: [R] Question about the smooth.Pspline

2007-03-06 Thread Petr Klasterecky
Xuhong Zhu napsal(a): Hello, Everyone, I want to use the smooth.Pspline to smooth my data but R give me the error message as follows: Error in smooth.Pspline(sort.e$time, sort.e$cuff, method = 3) : X not strictly increasing my data looks like the following: id cuff

[R] qr decomposition issue inside lm

2007-03-06 Thread Horace Tso
Dear list, It's never happened to me before in such a simple exercise but is not going away and I've checked my data are good. I want a simple lm model with one response and one predictor, where N is about 4,200 * data set not exactly small. Both x and y are nice, continuous variables having

Re: [R] Memory Limits in Ubuntu Linux

2007-03-06 Thread Uwe Ligges
[EMAIL PROTECTED] wrote: I am an R user trying to get around the 2Gig memory limit in Windows, so here I am days later with a working Ubuntu, and R under Ubuntu. But - the memory problems seem worse than ever. R code that worked under windows fails, unable to allocate memory. Searching

Re: [R] Subseting data frame based on column names

2007-03-06 Thread Uwe Ligges
Li, Aiguo (NIH/NCI) [C] wrote: Hello all, I have a data frame containing 170 columns and would like to generate a new data frame containing all rows but only 67 columns selected according to column names. How can I do this? For date.frame d and column names in vector cn: d[,cn]

[R] Substituting functions in package - Lattice

2007-03-06 Thread Saptarshi Guha
Hi, I'm trying to learn how a package works but substituting a parituclart function with my own (basically the original one with some debug statements). The package is lattice and the method is print.trellis which is a S3 method and is not visible. To replace this, i

Re: [R] Generate random numbers up to one

2007-03-06 Thread Ted Harding
On 06-Mar-07 Alberto Monteiro wrote: Ted Harding wrote: And, specifically (to take just 2 RVs X and Y), while U = X/(X+Y) and V = Y/(A+Y) are two RVs which summ to 1, the distribution of U is not the same as the distribution of X conditional on (X+Y = 1). This question Which question?

Re: [R] Generic distributions

2007-03-06 Thread Greg Snow
I think the distr package does this. There are also packages that link to winbugs if that is what you really want to do. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED]

[R] Stangle and annotate

2007-03-06 Thread Brett Presnell
How exactly should I go about turning off annotation when running Stangle (Rtangle) with R CMD Stangle myfile.Rnw? Ideally I would like to be able to turn annotation off and on for individual code chunks, or maybe better, to annotate only named chunks. Are either of these things easily done?

Re: [R] Recalling and printing multiple graphs. Is there something in the HISTORY menu that will help?

2007-03-06 Thread Mike Prager
John Sorkin [EMAIL PROTECTED] wrote: I have written an R function that produces multiple graphs. I use par(ask=TRUE) to allow for the inspection of each graph before the next graph is drawn. I am looking for a way to recall all graphs drawn in an R session, and a method that can be used to

Re: [R] Memory Limits in Ubuntu Linux

2007-03-06 Thread Christos Hatzis
Take a look at Windows FAQ 2.9. Following the instructions there, I was able to make WinXP use at least 3GB of RAM (physical RAM installed) with Rgui.exe. -Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938-3830

Re: [R] Obtaining figures with exactly placed points

2007-03-06 Thread Scionforbai
plot(0,0,n,xlim=c(0,1),ylim=c(0,1),axes=F,ann=F,xaxs='i',yaxs='i') It was exactly this! *8/100+ [1] 1199.88 Thanks, Marco __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Subseting data frame based on column names

2007-03-06 Thread Greg Snow
Use the subset function and the select argument of that function to specify the columns. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On

Re: [R] Obtaining figures with exactly placed points

2007-03-06 Thread Greg Snow
Try: plot(0,0,n,xlim=c(0,1),ylim=c(0,1),axes=F,ann=F,xaxs='i',yaxs='i') To see if that fixes it for you (without the xaxs and yaxs arguments it adds 4% of the range to each side so that any points plotted do not fall to close to the axes. Hope this helps, -- Gregory (Greg) L. Snow Ph.D.

Re: [R] Substituting functions in package - Lattice

2007-03-06 Thread Greg Snow
You need to set the environment on your version of print.trellis to match that of the original (at least that is what has worked for me when trying to do modified functions from the trellis package). Try something like: environment(print.trellis) - environment(lattice::print.trellis) Hope this

Re: [R] Substituting functions in package - Lattice

2007-03-06 Thread Saptarshi Guha
Hi, Unfortunately, print.trellis is not exported . environment(print.trellis) - environment(lattice::print.trellis) returns Error: 'print.trellis' is not an exported object from 'namespace:lattice' I then took the environment of lattice search()

[R] qr decomposition issue inside lm (solved)

2007-03-06 Thread Horace Tso
Folks, apologize for such an obvious oversight on my part. The reason qr fails is, one of the data points has value of -Inf (response is actually the log of something, and I have a zero in the original set). That explains the error message in call to dqrls. I should have taken the mean of the

Re: [R] Substituting functions in package - Lattice

2007-03-06 Thread Saptarshi Guha
Hi, Got it. This worked environment(print.trellis) - getNamespace(lattice) where print.trellis is my modified print.trellis. Thanks. Regards Saptarshi Saptarshi Guha | [EMAIL PROTECTED] | http://www.stat.purdue.edu/~sguha On Mar 6, 2007,

Re: [R] Stangle and annotate

2007-03-06 Thread Duncan Murdoch
On 3/6/2007 5:20 PM, Brett Presnell wrote: How exactly should I go about turning off annotation when running Stangle (Rtangle) with R CMD Stangle myfile.Rnw? Ideally I would like to be able to turn annotation off and on for individual code chunks, or maybe better, to annotate only named

Re: [R] R and SAS proc format

2007-03-06 Thread Jason Barnhart
- Original Message - From: John Kane [EMAIL PROTECTED] To: lamack lamack [EMAIL PROTECTED]; R-help@stat.math.ethz.ch Sent: Tuesday, March 06, 2007 2:13 PM Subject: Re: [R] R and SAS proc format --- lamack lamack [EMAIL PROTECTED] wrote: Dear all, Is there an R equivalent to SAS's

[R] Waiting for Key input

2007-03-06 Thread Saptarshi Guha
Hi, I have another question. Is there any command that waits for key input? I am running R on OS X, so getGraphicsEvents doesn't work. I have put some debug print messages in a function and would like to pause the code every time the message is printed and continue on a

Re: [R] Question

2007-03-06 Thread Michael Kubovy
How can I evaluate two or more expressions to return two or more columns? eval(expression(with(bd,Var1*100),with(bd,Var2*200))) The execution is always for the last expression. I can't execute the two expressions at the same time. It is possible? How about something like this with(bd,

Re: [R] Estimating parameters of 2 phase Coxian using optim

2007-03-06 Thread Gad Abraham
Andy Fugard wrote: Hi There, Perhaps the problem is the line loglik-log(p %*% expm(Q * y(i)) %*% q) You mention that y is a vector but here you're treating it as a function. Maybe try loglik-log(p %*% expm(Q * y[i]) %*% q) ? Don't have a clue about the

Re: [R] R plug in for Eclipse

2007-03-06 Thread Harry Ho
Hi Dominik, Yes, I am currently running Version: 3.2.2 Build id: M20070212-1330 From: Dominik Holenstein [EMAIL PROTECTED] To: Harry Ho [EMAIL PROTECTED] Subject: Re: [R] R plug in for Eclipse Date: Tue, 6 Mar 2007 23:00:29 +0100 Hi, Are you using Eclipse 3.2? semanticum 2007/3/6, Harry Ho

Re: [R] Off topic:Spam on R-help increase?

2007-03-06 Thread Marc Schwartz
On Tue, 2007-03-06 at 12:36 -0600, Douglas Bates wrote: On 3/6/07, Peter Dalgaard [EMAIL PROTECTED] wrote: Bert Gunter wrote: Folks: In the past 2 days I have seen a large increase of spam getting into R-help. Are others experiencing this problem? If so, has there been some

Re: [R] Memory Limits in Ubuntu Linux

2007-03-06 Thread Dirk Eddelbuettel
On 6 March 2007 at 12:43, [EMAIL PROTECTED] wrote: | I am an R user trying to get around the 2Gig memory limit in Windows, so The real limit on 32bit systems is a 3gb address space. R under Windows can get there, see the R-Windows FAQ. | here I am days later with a working Ubuntu, and R under

[R] Sigmoidal Fitting

2007-03-06 Thread Cressoni, Massimo \(NIH/NHLBI\) [F]
I want to thank professor Tura for his help but the function in some cases fails to converge and I am not able to understand the reason : GAS [1] 0.8108649 1.0386906 1.1638837 2.4144286 PRESSURE [1] 0 5 15 45 model.1 - nls(GAS_PER_G ~ SSlogis(PRESSURE, ASym, xmid, scal)) model.1 -

[R] Sweave issue: quotes in verbatim-like output print incorrectly

2007-03-06 Thread Peter Dunn
Hi all I love Sweave; use it all the time. But I recently received a new computer, and ever since I have had a problem I've never seen before. For example, I place the following in my Snw file: = sms -

Re: [R] Waiting for Key input

2007-03-06 Thread Petr Klasterecky
?browser ?readline Petr Saptarshi Guha napsal(a): Hi, I have another question. Is there any command that waits for key input? I am running R on OS X, so getGraphicsEvents doesn't work. I have put some debug print messages in a function and would like to pause the code

Re: [R] Generic distributions

2007-03-06 Thread Matthias Kohl
Hello Alberto, hello Greg, in distr you can do: library(distr) N - Norm(mean = 1, sd = 2) p(N)(0.5) r(N)(100) !!! not: p(N, 0.5) or r(N, 100) !!! A detailed description of package distr is given in package distrDoc. library(distrDoc) vignette(distr) hth Matthias - original message

[R] Autogenerate tags in tag=value pairs for

2007-03-06 Thread Jon Olav Vik
Dear list, Is there a way to programmatically specify tag names for the ... (ellipsis) part of the argument list to a function? In other words, a way to do this: x - data.frame(A=1:5) if the name A was not hardcoded but given by a variable, and without resorting to: x - data.frame(1:5)

<    1   2