Re: [R] fatal error: unable to restore saved data

2010-06-27 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 26.06.2010 00:11:33: > Albert - > The message refers to a file specifically called ".RData". > Files with subscripts of .rdata are not related. > You can see your current working directory by typing > > getwd() > > at the R prompt. > > I'

Re: [R] optim() not finding optimal values

2010-06-27 Thread Rubén Roa
Derek, As a general strategy, and as an alternative to parscale when using optim, you can just estimate the logarithm of your parameters. So in optim the par argument would contain the logarithm of your parameters, whereas in the model itself you would write exp(par) in the place of the paramet

Re: [R] sampling one random frame from each unique trial?

2010-06-27 Thread Daniel Malter
Hi, take the following example and proceed accordingly. Name=c("Miller","Miller","Miller","Miller","Smith","Smith","Smith","Smith") X=rnorm(8) Year=rep(2000:2003,2) d=data.frame(Name,X,Year) #Row indices rows=1:dim(d)[1] #Which Name occupies which rows? #"Name" would be your "file" w=function(

[R] sampling one random frame from each unique trial?

2010-06-27 Thread Kristiina Hurme
hello everyone. please bear with me if this is very easy... I have a data set with many trials, and frames within each trial. I would like to pull out one random frame from each trial. here is an example. i have 4 unique trials (file), and various frames within each (time_pred). I would like to

Re: [R] Lattice plotting question

2010-06-27 Thread David Warren
That achieves the desired alignment, but squishes all of the data in the top xyplot, which has a maximum y-value of around 50. Any thoughts on a means of moving the axis without changing the range? Thanks! On Fri, Jun 25, 2010 at 6:42 PM, Felix Andrews wrote: > ylim = extendrange(c(0,100)) ? >

Re: [R] inf.rm function?

2010-06-27 Thread David Winsemius
On Jun 25, 2010, at 9:31 PM, Julia Choi wrote: Dear All: I have been trying to remove "Inf" values from a series of data (multiple ratio operations). I have tried the na.rm() function (and tried this inside mean(), median(), and var()) but this does not always work. Though the !is.finite

Re: [R] Label Values in levelplot

2010-06-27 Thread Felix Andrews
something like panel = function(x, y, z, ...) { panel.levelplot(x, y, z, ...) panel.text(x, y, labels = z) } (if you have multiple panels you will need to use 'subscripts' too) On 25 June 2010 13:16, Ben Wilkinson wrote: > I am trying to add labels equal to the value in a levelplot. I b

Re: [R] Lattice plotting question

2010-06-27 Thread Felix Andrews
Oh, if you want to put the panels on the same scale, see resizePanels() from the latticeExtra package. That does something like print(xyplot(...), panel.height = list(x = c(50,100), units = "null")) but figures out the ratios automatically. -Felix On 28 June 2010 08:46, David Warren wrote: > T

Re: [R] NeweyWest

2010-06-27 Thread Achim Zeileis
On Sun, 27 Jun 2010, Jurica Brajkovi? wrote: I want to calculate Newey West robust standard error using NeweyWest. Comparing the results to what I get in STATA, in order to get the same results in I need to specify "prewhite=0". Can someone explain what this prewhite command means? It contro

Re: [R] Offscreen rendering in RGL?

2010-06-27 Thread Duncan Murdoch
On 27/06/2010 12:58 PM, Matthew Neilson wrote: Hi there, I've written a script for reading 3D simulation data into R, rendering it using RGL, and then saving the resulting plot using the snapshot3d() function. The results are fantastic! However, whenever RGL plots anything it automatically

Re: [R] several common sub-axes within multiple plot area

2010-06-27 Thread Karl Brand
Jim, What a great function: exactly as i needed. I'm sure i'll be finding alot of use for the plotrix package. Sincere thanks for your fast help, cheers, Karl On 6/27/2010 8:52 AM, Jim Lemon wrote: On 06/26/2010 11:20 PM, Karl Brand wrote: Dear List, I'd really appreciate tip's or code dem

Re: [R] floating point in single precision

2010-06-27 Thread Sebastian Gibb
Am Sonntag, 27. Juni 2010, 08:39:10 schrieb Prof Brian Ripley: > On Sun, 27 Jun 2010, Sebastian Gibb wrote: > > Hello, > > > > is there a possibilty in R to convert numbers (double precision, 64bit) > > into single precision ones (32bit). > > I need that for compatibility reasons. Until now I call

[R] NeweyWest

2010-06-27 Thread Jurica Brajković
I want to calculate Newey West robust standard error using NeweyWest. Comparing the results to what I get in STATA, in order to get the same results in I need to specify "prewhite=0". Can someone explain what this prewhite command means? Thanks [[alternative HTML version deleted]]

Re: [R] Ways to work with R and Postgres

2010-06-27 Thread Whit Armstrong
http://github.com/armstrtw/unifieddbi which I use on 64bit linux. you are welcome to test it for 64 bit windows. are you able to compile yourself? or do you need a packaged version? -Whit 2010/6/27 顾小波 : > Hi, > > I post this message to the general r-help list hoping anyone within a wider >

Re: [R] mgcv out of memory

2010-06-27 Thread Uwe Ligges
On 27.06.2010 17:48, Geoffrey Smith wrote: Hello, I am trying to update the mgcv package on my Linux box and I keep getting an "Out of memory!" error. Does anyone know of a fix for this? Below is a snippet of the message that I keep getting: Thank you. Geoff ** R ** inst ** preparing package

[R] Offscreen rendering in RGL?

2010-06-27 Thread Matthew Neilson
Hi there, I've written a script for reading 3D simulation data into R, rendering it using RGL, and then saving the resulting plot using the snapshot3d() function. The results are fantastic! However, whenever RGL plots anything it automatically brings the viewing window into focus. Since I

[R] mgcv out of memory

2010-06-27 Thread Geoffrey Smith
Hello, I am trying to update the mgcv package on my Linux box and I keep getting an "Out of memory!" error. Does anyone know of a fix for this? Below is a snippet of the message that I keep getting: Thank you. Geoff ** R ** inst ** preparing package for lazy loading ** help *** installing help

Re: [R] optim() not finding optimal values

2010-06-27 Thread Derek Ogle
Ravi, Thank you very much for the pointer to parscale. This is extremely useful -- in this and some other problems that I am working on. Thanks again for the valuable help. > -Original Message- > From: Ravi Varadhan [mailto:rvarad...@jhmi.edu] > Sent: Saturday, June 26, 2010 11:52 PM

Re: [R] Calculating Summaries for each level of a Categorical variable

2010-06-27 Thread Christos Argyropoulos
Hi Raoul, I presume you need these summaries for a table of descriptive statistics for a thesis/report/paper ("Table 1" as known informally by medical researchers). If this is the case, then specify method="reverse" to summary.formula. In the following small example, I create 4 groups of pat

Re: [R] how to group a large list of strings into categories based on string similarity?

2010-06-27 Thread Martin Morgan
On 06/26/2010 11:42 AM, G FANG wrote: > Hi Martin, > > Thanks a lot for your advice. > > I tried the process you suggested as below, it worked, but in a > different way that I planned. > > library(Biostrings) > x <- c("ACTCCCGCCGTTCGCGCGCAGCATGATCCTG", > "ACTCCCGCCGTTCGCGCGC",

Re: [R] Calculating Summaries for each level of a Categorical variable

2010-06-27 Thread David W Freedman
I'd suggest using the functions within the Hmisc and plyr packages: library(Hmisc); library(plyr) df=data.frame(v1=rnorm(10), v2=rnorm(10), wt=sample(1:5,rep=T),sex=rep(0:1,each=5)); df ddply(df,~sex,summarise,v1.avg=wtd.mean(v1,wt),v2.avg=wtd.mean(v2,wt)) hope this helps, david freedman -- Vi

Re: [R] Euclidean Distance Matrix Analysis (EDMA) in R?

2010-06-27 Thread Corey Sparks
I agree, i've seen procrustes in R, but not EDMA, R has natural support for bootstrapping via the boot() library, i'm sure others would be grateful if you wanted to write some functions.. CS Corey Sparks Assistant Professor Department of Demography and Organization Studies College of Public

Re: [R] Calculating Summaries for each level of a Categorical variable

2010-06-27 Thread Corey Sparks
the variable you want to analyze (first argument to tapply) and the variable you want to analyze by (the factor, second arg to tapply) both must have the same number of rows, that' s how I read this. CS Corey Sparks Assistant Professor Department of Demography and Organization Studies College

Re: [R] Calculating Summaries for each level of a Categorical variable

2010-06-27 Thread David Hajage
You could try the remix function in remix package. David Le 27 juin 2010 à 06:48, RaoulD a écrit : > > Hi Christos, > > Thanks for this. I had a look at Summary.Forumla in the Hmisc > package and it > is extremely complicated for me. Still trying to decipher how I > could use > it. > > Regards,

Re: [R] Euclidean Distance Matrix Analysis (EDMA) in R?

2010-06-27 Thread gokhanocakoglu
I am using EDMA software and I have couple of papers about statistical shape analysis and you are right about bootstrapping. Wish R has an EDMA package and we could see how the results compatible with EDMA software. -- View this message in context: http://r.789695.n4.nabble.com/Euclidean-Distan

Re: [R] Calculating Summaries for each level of a Categorical variable

2010-06-27 Thread RaoulD
Hi Corey, Thanks so much for this. However, I get this error for tapply - "Error in tapply(RT, RT$R, fun=WA): arguments must have same length". Any idea how to get around this? Thanks again, Raoul -- View this message in context: http://r.789695.n4.nabble.com/Calculating-Summaries-for-each-

Re: [R] Calculating Summaries for each level of a Categorical variable

2010-06-27 Thread RaoulD
Hi Christos, Thanks for this. I had a look at Summary.Forumla in the Hmisc package and it is extremely complicated for me. Still trying to decipher how I could use it. Regards, Raoul -- View this message in context: http://r.789695.n4.nabble.com/Calculating-Summaries-for-each-level-of-a-Catego

Re: [R] Recoding dates to session id in a longitudinal dataset

2010-06-27 Thread JP Bogers
Hi Jim, Thanks for the answer. What I actually want is a session sequence 1,2,... per patient. This would be very useful to look at trends of HPV infections from the first to the second sample etc. It would also allow me to extract the HPV data of the first sample (session 1). Thx JP On Sat, Ju