[R] lattice multipanel strip placement - with two factors

2009-03-23 Thread Dan Kortschak
Hi, I'm making a multipanel lattice densityplot figure with 2 factors (3 and 20 classes in each factor) with the following statement (the type=percent is there to prevent plotting the actual points which detract from the figure - is there another way of doing this?): densityplot(~End-Begin |

[R] Parameter Estimation - 3 Paramter Gamma distribution

2009-03-23 Thread maithili_shiva
Der r helpers, I have a following set of data. Though some other software, I know it follows 3 parameter Gamma distrinution. I need to write a R code for estimating the parameters of 3 Parameter Gamma distribution. c(0,0,18561.9,0,0,0,34400,0,0,0,0,2190,0,0,0,0,6,0,0,0,  

[R] changing order of lattice plots

2009-03-23 Thread Dan Kortschak
Hi, This is another question relating to my 2 factor figure. densityplot(~End-Begin | Type * Chromosome, data=Mon, layout=c(5,12), xlab=Element Length,type=percent, col=grey60, strip=strip.custom(style=3, bg=grey90, par.strip.text=list(cex=0.5))) I would like to flip the plot so those at the

Re: [R] changing order of lattice plots

2009-03-23 Thread Dimitris Rizopoulos
try setting the 'as.table' argument to TRUE, e.g., densityplot(~End-Begin | Type * Chromosome, data=Mon, layout=c(5,12), xlab=Element Length, type=percent, col=grey60, strip=strip.custom(style=3, bg=grey90, par.strip.text=list(cex=0.5)), as.table = TRUE) I hope it helps. Best, Dimitris

Re: [R] If statement generates two outputs

2009-03-23 Thread Wacek Kusnierczyk
jimdare wrote: Hi, I tried to create the following if / else statement but I keep getting the error Error: unexpected '}' in size=large,center=none) } (I have highlighted the } in bold where the error is occuring). I can't seem to find a reason for this, does anyone know how I can fix it?

Re: [R] changing order of lattice plots

2009-03-23 Thread Dan Kortschak
Perfect! Thanks. Dan On Mon, 2009-03-23 at 08:35 +0100, Dimitris Rizopoulos wrote: try setting the 'as.table' argument to TRUE, e.g., densityplot(~End-Begin | Type * Chromosome, data=Mon, layout=c(5,12), xlab=Element Length, type=percent, col=grey60, strip=strip.custom(style=3, bg=grey90,

Re: [R] Help with 'boot'

2009-03-23 Thread Camille LEPOITTEVIN
Hi Paul, I struggled with the boot package too, and I found this help link very useful: http://www.mayin.org/ajayshah/KB/R/documents/boot.html Getting started with the boot package in R for bootstrap inference. I hope you'll find what you need there ! The second argument for the bootstrap test

Re: [R] lattice multipanel strip placement - with two factors

2009-03-23 Thread baptiste auguie
I'm not sure I understood your problem (can you provide an reproducible example?), but perhaps you can try useOuterStrips() in the latticeExtra package (the formatting becomes similar to that of the ggplot2 package, perhaps another option to consider) Hope this helps, baptiste On 23 Mar

[R] performance: zoo's rollapply() vs inline

2009-03-23 Thread Ken-JP
zoo's rollapply() function appears to be extremely useful for plugging in a function on-the-fly to run over a window. With inline, there is a lot more coding and room for error, and the code is less portable because the user has to have R compiling set up or it won't work. However, rollapply()

[R] Syntax in lmer...

2009-03-23 Thread Anne Kempel
Sorry for bothering you - but I have a little problem. I`m completely new in R and trying to use lmer. That works, but I m not sure if my code is right, so I would just like to get an opinion from the experts. I have a Growthrate of plants (RGR Fixed Factors: Fertilizer, Status (alien or

[R] How to get commands history as a character vector instead of displaying them?

2009-03-23 Thread Yihui Xie
Hi Everyone, I want to get the commands history as a character vector instead of just displaying them, but the function history() just returns NULL. I checked the source code of 'history' and could not find a solution. Anybody has an idea? Thanks! P. S. My original problem is, when a user opens

Re: [R] performance: zoo's rollapply() vs inline

2009-03-23 Thread Achim Zeileis
On Mon, 23 Mar 2009, Ken-JP wrote: zoo's rollapply() function appears to be extremely useful for plugging in a function on-the-fly to run over a window. With inline, there is a lot more coding and room for error, and the code is less portable because the user has to have R compiling set up or

Re: [R] How to get commands history as a character vector instead of displaying them?

2009-03-23 Thread Romain Francois
Yihui Xie wrote: Hi Everyone, I want to get the commands history as a character vector instead of just displaying them, but the function history() just returns NULL. I checked the source code of 'history' and could not find a solution. Anybody has an idea? Thanks! history eventually calls

Re: [R] Syntax in lmer...

2009-03-23 Thread ONKELINX, Thierry
Dear Anne, Is age a continuous or a categorical variable? If it is a continuous variable, then I would add it to the fixed effects. You have two options for the random effect: (Fertilier|Family/Species) or (1|Family/Species) + (0 + Fertilizer|Family/Species). Both yield a random intercept and a

Re: [R] lattice multipanel strip placement - with two factors

2009-03-23 Thread Dan Kortschak
That's part way to my desired solution, but not completely there. Here's an example: chromosome-rep(c(A,X,Y),time=20) type-rep(c(1:20),times=3) length-rnorm(60) densityplot(~length | type * chromosome, layout=c(5,12)) What I would like to see is the chromosome strip (A, X, Y) once on the left

Re: [R] How to get commands history as a character vector instead of displaying them?

2009-03-23 Thread Erich Neuwirth
Your original question probably is answered by dev.cur and dev.list Yihui Xie wrote: Hi Everyone, I want to get the commands history as a character vector instead of just displaying them, but the function history() just returns NULL. I checked the source code of 'history' and could not

Re: [R] performance: zoo's rollapply() vs inline

2009-03-23 Thread Gabor Grothendieck
On Mon, Mar 23, 2009 at 5:08 AM, Achim Zeileis achim.zeil...@wu-wien.ac.at wrote: On Mon, 23 Mar 2009, Ken-JP wrote: zoo's rollapply() function appears to be extremely useful for plugging in a function on-the-fly to run over a window.  With inline, there is a lot more coding and room for

[R] Efficiently create dummy

2009-03-23 Thread Rob Denniker
What's the neat way to create a dummy from a list? The code below is not replicable, but hopefully self-explanatory... d$treatment-rep(1,length(d)) notreat-c(AR, DE, MS, NY, TN, AK, LA, MD, NC, OK, UT, VA) #i would really like this to work: d$treatment[d$st==any(notreat)]-0 #but instead i

Re: [R] Efficiently create dummy

2009-03-23 Thread Dimitris Rizopoulos
well, you can first define a factor, and the use model.matrix(), e.g., fc - factor(c(AR, DE, MS, NY)) model.matrix(~ fc) for more info check ?model.matrix(), e.g., if you want to change the contrasts. I hope it helps. Best, Dimitris Rob Denniker wrote: What's the neat way to create a

Re: [R] xlsReadWrite library

2009-03-23 Thread Hans-Peter Suter
2009/3/19 Pascal Candolfi pcando...@gmail.com: Any idea why this library was removed and where could I find it for Windows (only Unix in the Archive) ? As indicated it was for for the binary (non FOSS) component. Yesterday I checked the existing packages (xlsReadWrite(Pro) on

Re: [R] Efficiently create dummy

2009-03-23 Thread Chuck Cleland
On 3/23/2009 5:44 AM, Rob Denniker wrote: What's the neat way to create a dummy from a list? The code below is not replicable, but hopefully self-explanatory... d$treatment-rep(1,length(d)) notreat-c(AR, DE, MS, NY, TN, AK, LA, MD, NC, OK, UT, VA) #i would really like this to work:

Re: [R] How to get commands history as a character vector instead of displaying them?

2009-03-23 Thread Wacek Kusnierczyk
Romain Francois wrote: Yihui Xie wrote: Hi Everyone, I want to get the commands history as a character vector instead of just displaying them, but the function history() just returns NULL. I checked the source code of 'history' and could not find a solution. Anybody has an idea? Thanks!

Re: [R] fisher.test - FEXACT error 7

2009-03-23 Thread Bernardo Rangel Tura
On Fri, 2009-03-20 at 18:29 +, Helena Mouriño wrote: Dear all, Im having an awkward problem in R. When I write the command Fisher.test(school.data,workspace=2e+07), where school.data is the matrix corresponding to the data set, I get the error message: FEXACT error 7. LDSTP is too

[R] subset and or operator

2009-03-23 Thread lauramorg...@bluewin.ch
Hello, I'm trying to subset a dataframe where I have many observation taken in different years. I would like to subset the dataframe (in this example called table) to get a new dataframe containing only the observation of year 1995, 1998 and 2000. I've tried to use subset and the or operator |

Re: [R] any package for connecting berkeley db in R?

2009-03-23 Thread Bernardo Rangel Tura
On Fri, 2009-03-20 at 17:23 -0400, Zheng, Xin (NIH) [C] wrote: Hi there, Is there any such package? I searched but found none. Thanks in advance. Xin Zheng Hi Xin Do you try package DBI? -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil

Re: [R] newton method

2009-03-23 Thread Rau, Roland
Hi, you might be also interested in a general overview as given here: http://cran.r-project.org/web/views/Optimization.html Hope this helps, Roland -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Michael Kubovy Sent: Monday,

Re: [R] subset and or operator

2009-03-23 Thread Erich Neuwirth
subset(table, year %in% c(1995,1998,2000))--table2 Hello, I'm trying to subset a dataframe where I have many observation taken in different years. I would like to subset the dataframe (in this example called table) to get a new dataframe containing only the observation of year 1995, 1998

Re: [R] Capitalizing first letter of word or phrase

2009-03-23 Thread Gabor Grothendieck
See examples on ?toupper page. On Mon, Mar 23, 2009 at 8:03 AM, Daren Tan darenta...@gmail.com wrote: I managed to find toupper() which translates all letters to uppercase. Is there a function to capitalize only the first letter of word or phrase ? Thanks

[R] Iterative Proportional Fitting, use

2009-03-23 Thread Koen Hufkens
Hi list, I would like to normalize a matrix (two actually for comparison) using iterative proportional fitting. Using ipf() would be the easiest way to do this, however I can't get my head around the use of the function. More specifically, the margins settings... for a matrix: mat -

Re: [R] fisher.test - FEXACT error 7

2009-03-23 Thread Frank E Harrell Jr
Bernardo Rangel Tura wrote: On Fri, 2009-03-20 at 18:29 +, Helena Mouriño wrote: Dear all, Im having an awkward problem in R. When I write the command Fisher.test(school.data,workspace=2e+07), where school.data is the matrix corresponding to the data set, I get the error message:

Re: [R] Problems with combining plots

2009-03-23 Thread johnhj
I have still the same problem... As you said I tried with par(mfrow=c(2,1)) and par(mfrow=c(1,2)) but without success. Could R compiler be the problem ? Wills, Kellie wrote: par(mfrow=c(1,1)) will give you just one panel. Try par(mfrow=c(2,1)) or par(mfrow=c(1,2)). -Original

[R] help

2009-03-23 Thread Dominique Katshunga
Dear R-users, Can someone help understand why in the following example R would return a negative value for the last parameter when I have constrained it to be positive and greater than or equal to 0.01? nlminb(start=initial value,objective=some function,

Re: [R] Iterative Proportional Fitting, use

2009-03-23 Thread Gerard M. Keogh
Keon, why not fit a loglinear independence model which as far as I know is the same. Gerard Here's an example from Agresti - Intro to Cat Data analysis Example: Alcohol, cigarette, marijuana use |--+--+| | Alcohol |

Re: [R] Iterative Proportional Fitting, use

2009-03-23 Thread Koen Hufkens
The data I used was just an example to work upon. My real dataset is a confusion matrix of 24x24 (and 17x17), so coding it into a model with all different kinds of combinations seems tedious. That's why I hoped to use the ipf() function as it accepts a matrix as input. Thanks for the suggestion

[R] how to estimate multidimensional spectral measure of coherence

2009-03-23 Thread mauede
Please, does anyone know of an R packge to estimate multidimensional spectral measure of coherence within a moving time window ? Some time ago I expeimented with a similar package that performs Cross Spectrum Analysis on the whole signal though. Unluckily I deal with non-stationary signals whose

Re: [R] Problems with combining plots

2009-03-23 Thread baptiste auguie
On 23 Mar 2009, at 11:52, johnhj wrote: I have still the same problem... As you said I tried with par(mfrow=c(2,1)) and par(mfrow=c(1,2)) but without success. Could R compiler be the problem ? Why not? But may I suggest you try first the following example I sent you yesterday,

Re: [R] Iterative Proportional Fitting, use

2009-03-23 Thread Ravi Varadhan
Hi, Is this what you want? # mat - matrix(c(65,4,22,24,6,81,5,8,0,11,85,19,4,7,3,90),4,4) rowmarg - rep(100, nrow(mat)) # the row margin totals that you want colmarg - c(90, 120, 80, 110) # the column margin totals that you want newmat - loglin( outer(rowmarg, colmarg) / sum(rowmarg),

[R] how to save a plot in a given size in inches or centimeters

2009-03-23 Thread Lo_Lo
Hi there ! I'm ploting graphics and I'd like to save them as a .jpeg file for example, but with a given size (in inches or cm). I tryed the function windows() but I think it just changes the size of the window and not the size of the graph that you're saving. Then I tryed with the function

Re: [R] using wavelet transform to calculate mean frequency of a signal

2009-03-23 Thread stephen sefick
global wavelet spectrum? There is something somewhere - I just can't remember where off the top of my head. Stephen Sefick On Sun, Mar 22, 2009 at 2:21 PM, stvienna wiener stvie...@gmail.com wrote: Dear list, in short: I would like to calculate the mean frequency of a signal (e.g. time

Re: [R] how to save a plot in a given size in inches or centimeters

2009-03-23 Thread stephen sefick
isn't there a width height argument in the jpeg function? ?jpeg I am probably wrong, Stephen Sefick On Mon, Mar 23, 2009 at 10:38 AM, Lo_Lo tchiba...@hotmail.com wrote: Hi there ! I'm ploting graphics and I'd like to save them as a .jpeg file for example, but with a given size (in inches or

[R] Problems with adapt

2009-03-23 Thread Cristian Angelo Guevara
Hi: I'm trying to estimate a model which involves the estimation of double integrals, so I'm using adapt procedure. I need to calculate the integrals trough my 2000 size database, so I do it using a loop. My code correctly estimates the integral for the first row, but for the second R crashes. I

Re: [R] how to estimate multidimensional spectral measure of coherence

2009-03-23 Thread stephen sefick
have you tried sowas? I know you had talked about it, but it may do what you want. I have used it for the wavelet cross spectrum. On Mon, Mar 23, 2009 at 9:47 AM, mau...@alice.it wrote: Please, does anyone know of an R packge to estimate multidimensional spectral measure of coherence within

Re: [R] 'require' equivalent for local functions

2009-03-23 Thread JiHO
Thanks very much to everyone. I think I will use a combination of both techniques. On 2009-March-22 , at 20:08 , Duncan Murdoch wrote: That's pretty hard to make bulletproof. Why not just put those functions in a package, and use that package? I know it will be impossible to make

[R] Scaled MPSE as a test for regressors?

2009-03-23 Thread Zhou Fang
Hi, This is really more a stats question than a R one, but Does anyone have any familiarity with using the mean prediction squared error scaled by the variance of the response, as a 'scale free' criterion for evaluating different regression algorithms. E.g. Generate X_train, Y_train,

[R] R: how to estimate multidimensional spectral measure of coherence

2009-03-23 Thread mauede
Does it work on a sliding window ? Does it estimate the cospectrum (the real part) and the quadrature spectrum (complex), the coherence squared, and the phase difference between two vector time series ? SOme time ago I started to read its author's thesis. It seemed to me strictly tailored on

[R] aggregate() example fails

2009-03-23 Thread Kenneth Roy Cabrera Torres
Hi R users and developers. I compile the R version 2.8.1 Patched (2009-03-18 r48193) On my UBUNTU linux distribution. But hen I ask for the aggregate example it fails. What am I missing? example(aggregate) aggrgt ## Compute the averages for the variables in 'state.x77', grouped aggrgt ##

Re: [R] R: Multi-line texts in plots

2009-03-23 Thread Greg Snow
Look at the textplot function in the gplots package and the addtable2plot function in the plotrix package. Either of those make it easy to 'plot' a matrix. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111

Re: [R] how to save a plot in a given size in inches or centimeters

2009-03-23 Thread David M Smith
On Mon, Mar 23, 2009 at 7:38 AM, Lo_Lo tchiba...@hotmail.com wrote: I'm ploting graphics and I'd like to save them as a .jpeg file for example, but with a given size (in inches or cm). I tryed the function windows() but I think it just changes the size of the window and not the size of the

Re: [R] variance/mean

2009-03-23 Thread Bert Gunter
Inline Below. -- Bert Bert Gunter Genentech Nonclinical Biostatistics 650-467-7374 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Wacek Kusnierczyk Sent: Sunday, March 22, 2009 2:16 AM To: rkevinbur...@charter.net Cc:

[R] Looping of read.table and assignment

2009-03-23 Thread Steve Murray
Dear all, I am trying to read in and assign data from 50 tables in an automated fashion. I have the following code, which I created with the help of textbooks and the internet, but it only seems to read in the final data file over and over again. For example, when I type: table_1951 I get

Re: [R] Plot and Boxplot in the same graph

2009-03-23 Thread Greg Snow
Look at the symbols function or the subplot function in the TeachingDemos package (or my.symbols in TeachingDemos). Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From:

Re: [R] Looping of read.table and assignment

2009-03-23 Thread Gabor Grothendieck
See: https://stat.ethz.ch/pipermail/r-help/2009-March/192422.html On Mon, Mar 23, 2009 at 12:52 PM, Steve Murray smurray...@hotmail.com wrote: Dear all, I am trying to read in and assign data from 50 tables in an automated fashion. I have the following code, which I created with the help

Re: [R] Looping of read.table and assignment

2009-03-23 Thread baptiste auguie
You need only one loop, year - 1951:2000 filelist - paste(C:\\Documents and Settings\\Data\ \table_,year,.txt, sep=) filelist for (ii in seq_along(year)) { assign(paste(table_, year[ii], sep=), read.table(file=ifile[ii], header=TRUE, sep=,)) }

[R] Fitting multiple Gaussians to data

2009-03-23 Thread Blake Sweeney
Hello, I am trying to fit several Gaussian distributions to a data set. I need to know the mean, standard deviation and maximum of each Gaussian. My data set is simply a list of signal strengths and no other information. I do not know the number of Guassians to fit. I've looked at some packages

[R] Extracting SD of random effects from lme object

2009-03-23 Thread Ben Domingue
Hello, How do I get the standard deviations for the random effects out of the lme object? I feel like there's probably a simple way of doing this, but I can't see it. Using the first example from the documentation: fm1 - lme(distance ~ age, data = Orthodont) # random is ~ age fm1 Linear

[R] How to set up a function for Central Limit Theorem

2009-03-23 Thread pfc_ivan
Hello guys, I am stuck here: How do I make 1000 samples of n = 10 observations from an Exponential distribution and then compute the mean for all those 1000 samples? Basically I need to prove the Central Limit theorem, which states:

[R] Replacing a few variable values within a DataFrame...

2009-03-23 Thread Jason Rupert
I would like to replace a few varaibles within a data frame. For example, in the dataframe below (contrived) I would like to replace the current housesize value only if the Location is HSV. However, I would like to leave the other values intact. I tried ifelse, but I don't really need

Re: [R] Replacing a few variable values within a DataFrame...

2009-03-23 Thread Jorge Ivan Velez
Dear Jason, Try this: index- with(test_data2_df,Location %in% HSV) test_data2_df$HouseSize-ifelse(index,1000,test_data2_df$HouseSize) # I used 1000 as reference test_data2_df HTH, Jorge On Mon, Mar 23, 2009 at 1:39 PM, Jason Rupert jasonkrup...@yahoo.comwrote: I would like to replace a

Re: [R] Replacing a few variable values within a DataFrame...

2009-03-23 Thread baptiste auguie
On 23 Mar 2009, at 17:39, Jason Rupert wrote: I would like to replace a few varaibles within a data frame. For example, in the dataframe below (contrived) I would like to replace the current housesize value only if the Location is HSV. However, I would like to leave the other values

[R] Copying a subset of a matrix

2009-03-23 Thread akintayo holder
Hi, I have a matrix and I want to create a matrix that includes every nth column of the original matrix. Does anyone know how I can go about doing that ? Or if you have an idea how I can do the same thing with a data frame ? If you can just point me towards the appropriate function I would

Re: [R] How to set up a function for Central Limit Theorem

2009-03-23 Thread stephen sefick
homework? On Mon, Mar 23, 2009 at 1:30 PM, pfc_ivan pfc_i...@hotmail.com wrote: Hello guys, I am stuck here: How do I make 1000 samples of n = 10 observations from an Exponential distribution and then compute the mean for all those 1000 samples? Basically I need to prove the Central Limit

Re: [R] How to set up a function for Central Limit Theorem

2009-03-23 Thread pfc_ivan
I tried using the for (i..) to make 1000 differents sets of numbers, but then I dont know how to get the mean value of all of them... because I dont even think 1000 different sets of numbers were made, because when i print it it always shows me the same values, basically I dont know how to

[R] repeated measures specification in lmer

2009-03-23 Thread Lawrence Hanser
Dear Colleagues, I have what Roger Kirk (Experimental Design: Procedures for the Behavioral Sciences, 1968) refers to as a randomized block factorial design. The anova table would look like this: df A 3 Subj/A 103 (error term for A) B

Re: [R] How to set up a function for Central Limit Theorem

2009-03-23 Thread baptiste auguie
(a - replicate(5,rnorm(10))) colMeans(a) should get you started. HTH, baptiste On 23 Mar 2009, at 18:29, pfc_ivan wrote: I tried using the for (i..) to make 1000 differents sets of numbers, but then I dont know how to get the mean value of all of them... because I dont even think 1000

Re: [R] How to set up a function for Central Limit Theorem

2009-03-23 Thread Peter Dalgaard
pfc_ivan wrote: I tried using the for (i..) to make 1000 differents sets of numbers, but then I dont know how to get the mean value of all of them... because I dont even think 1000 different sets of numbers were made, because when i print it it always shows me the same values, basically I dont

Re: [R] Replacing a few variable values within a DataFrame...

2009-03-23 Thread Jason Rupert
Phil and all, Thank you for the responses. That method worked great! However, I did try to replace the a few of the Variables using the same method and received an error... test_data2_df[test_data2_df$Location == 'HSV','Variables'] = YardSize Is there something special I need to do in

Re: [R] Copying a subset of a matrix

2009-03-23 Thread akintayo holder
Thanks. That worked. On Mon, Mar 23, 2009 at 2:17 PM, Phil Spector spec...@stat.berkeley.eduwrote: Suppose your matrix is called x. Then x[,seq(1,ncol(x),n)] will give you what you want. - Phil Spector

Re: [R] Basic regression output question

2009-03-23 Thread Kingsford Jones
On Mon, Mar 23, 2009 at 11:04 AM, GRANT Lewis l.gr...@hermes.co.uk wrote: [snip] factors-matrix(runif(400),nrow=40) returns1-matrix(runif(40),nrow=1) returns2-matrix(runif(2000),nrow=50) coef(summary(lm(t(returns1)~factors)))[1,4] [snip] (coef(summary(lm(t(returns2)~factors)))[50])[1,4]

Re: [R] How to set up a function for Central Limit Theorem

2009-03-23 Thread Charles Annis, P.E.
Ivan: While you're figuring out how to execute the CLT in R you may find my automated examples informative. http://StatisticalEngineering.com/central_limit_theorem.htm Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265

Re: [R] Extracting SD of random effects from lme object

2009-03-23 Thread Kingsford Jones
On Mon, Mar 23, 2009 at 11:26 AM, Ben Domingue ben.domin...@gmail.com wrote: Hello, How do I get the standard deviations for the random effects out of the lme object?  I feel like there's probably a simple way of doing this, but I can't see it.  Using the first example from the documentation:

Re: [R] Extracting SD of random effects from lme object

2009-03-23 Thread Ben Domingue
On Mon, Mar 23, 2009 at 1:18 PM, Kingsford Jones kingsfordjo...@gmail.com wrote: On Mon, Mar 23, 2009 at 11:26 AM, Ben Domingue ben.domin...@gmail.com wrote: Hello, How do I get the standard deviations for the random effects out of the lme object?  I feel like there's probably a simple way of

[R] specifying repeated measures model in lmer

2009-03-23 Thread Lawrence Hanser
Dear Colleagues, I have what Roger Kirk (Experimental Design: Procedures for the Behavioral Sciences, 1968) refers to as a randomized block factorial design. The anova table would look like this: df A 3 Subj/A 103 (error term for A) B

Re: [R] How to set up a function for Central Limit Theorem

2009-03-23 Thread Greg Snow
There is also the clt.examp function in the TeachingDemos package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf

Re: [R] Extracting SD of random effects from lme object

2009-03-23 Thread Douglas Bates
On Mon, Mar 23, 2009 at 2:18 PM, Kingsford Jones kingsfordjo...@gmail.com wrote: On Mon, Mar 23, 2009 at 11:26 AM, Ben Domingue ben.domin...@gmail.com wrote: Hello, How do I get the standard deviations for the random effects out of the lme object?  I feel like there's probably a simple way of

Re: [R] specifying repeated measures model in lmer

2009-03-23 Thread Douglas Bates
On Mon, Mar 23, 2009 at 2:35 PM, Lawrence Hanser lhan...@gmail.com wrote: Dear Colleagues, I have what Roger Kirk (Experimental Design: Procedures for the Behavioral Sciences, 1968) refers to as a randomized block factorial design.  The anova table would look like this:                      

Re: [R] Difference between gam() and loess().

2009-03-23 Thread Rolf Turner
On 21/03/2009, at 3:19 AM, Ravi Varadhan wrote: snip I also tried a number of other things including changing the family, and parameters in loess.control, but to no avail. I looked at the Fortran codes from both loess and gam. They are daunting, to say the least. They are dense,

[R] aggregate() problem on last patched version

2009-03-23 Thread Kenneth Roy Cabrera Torres
Hi R users and developers: Several hours ago I post a problem with the aggregate() function using the last patch version of R. (R version 2.8.1 Patched (2009-03-18 r48193)) I do compile again the 2.8.1 plain version (not patched) and now it works again, both the examples and my old scripts that

[R] Graphic with several curves

2009-03-23 Thread CE.KA
Hi R users, Imagine the folowing data frame 19901991 1992 1 5 20 6 2 15 1 11 3 3 14 22 4 20 8 55 5 10 3 14 Is there a way to build a graphic in which: - 1

[R] read in large data file (tsv) with inline filter?

2009-03-23 Thread David Reiss
I have a very large tab-delimited file, too big to store in memory via readLines() or read.delim(). Turns out I only need a few hundred of those lines to be read in. If it were not so large, I could read the entire file in and grep the lines I need. For such a large file; many calls to

[R] Merging rows in dataframes

2009-03-23 Thread Schraga Schwartz
Hello, I have a dataframe with 40 columns and around 450,000 rows. The first column in each row is a factor id and the remaining are numeric. Some rows have the same ids. What I want to do is to merge each set of rows sharing the same ids (id set) into one single row (summarizing row)

[R] [Fwd: Re: Graphic with several curves]

2009-03-23 Thread Kenneth Roy Cabrera Torres
- Mensaje reenviado De: Kenneth Roy Cabrera Torres krcab...@une.net.co Para: CE.KA ce.kay...@yahoo.fr Asunto: Re: [R] Graphic with several curves Fecha: Mon, 23 Mar 2009 17:02:48 -0500 try matplot(), but you have to transpose the matrix with option type=l. Example:

[R] Confusion regarding environments invoked by source command

2009-03-23 Thread Dennis Fisher
Colleagues, R version 2.8.1 in OS X Within a function (which is already within a function), I am sourcing a file. The syntax of the command is something like (this is just an example; the actual code is much more complicated): BIGFUNCTION - function() { DATAFRAME

Re: [R] read in large data file (tsv) with inline filter?

2009-03-23 Thread Dylan Beaudette
On Monday 23 March 2009, David Reiss wrote: I have a very large tab-delimited file, too big to store in memory via readLines() or read.delim(). Turns out I only need a few hundred of those lines to be read in. If it were not so large, I could read the entire file in and grep the lines I need.

Re: [R] Graphic with several curves

2009-03-23 Thread Jorge Ivan Velez
Dear CE.KA, If 'x' is your data, you could do something like the following: matplot(as.factor(c('1990','1992')),t(x[,-2]),type='l', xaxt='n',xlab='Year',ylab=Some label here,lty=1) axis(1,c(19901992),c(19901992)) legend('topleft',paste('Observation',1:5),col=1:5,lty=1,cex=0.8)

Re: [R] Accuracy of R and other platforms

2009-03-23 Thread John Maindonald
These comparisons are very simplistic. In most contexts, it would make much better sense to measure accuracy in standard error units, rather than in number of digits. There doubtless are specialist applications where the 15th digit (or even the 10th!) are important. But the check of

Re: [R] Confusion regarding environments invoked by source command

2009-03-23 Thread Duncan Murdoch
On 23/03/2009 6:06 PM, Dennis Fisher wrote: Colleagues, R version 2.8.1 in OS X Within a function (which is already within a function), I am sourcing a file. The syntax of the command is something like (this is just an example; the actual code is much more complicated): This code works

[R] Plot Means Line with Standard Deviation as Whiskers

2009-03-23 Thread Rodrigo Aluizio
Hi list members. I’ll try to plot the abundance means of nine transects as lines, with five points on each transect (A to I). I will also need to plot for each point, it’s standard deviation (once each point will have tree replicates) as whiskers. Another problem will be that all the points

Re: [R] .Internal

2009-03-23 Thread rkevinburton
Sorry to be so dense but the article that you suggest does not give any information on how the arguments are packed up. I look at the call: val - .Internal(fmin(function(arg) -f(arg, ...), lower, upper, tol)) and then with the help of this article I find do_fmin in optimize.c: SEXP

Re: [R] Merging rows in dataframes

2009-03-23 Thread Gabor Grothendieck
Using sqldf you only need two statements, infile - file(...) and DF - sqldf(select min(a), max(b), mean(c), ... from infile group by id). The file statement identifies the filename and the second reads it into sqlite (without going through R), summarizes it and then reads the summarized version

Re: [R] Plot Means Line with Standard Deviation as Whiskers

2009-03-23 Thread Peter Alspach
Tena koe Rodrigo You could always make up some data and then show us what you have tried to do. I would guess you need to check out: plot # to do the basic plot lines # to add lines to the plot points # to add points to the plot arrows # can be used to give the whiskers apply # to get the

Re: [R] Plotting with plot()

2009-03-23 Thread Peter Dalgaard
Satindra Chakravorty wrote: I am trying to use the plot() function in R but can't seem to generate any plots. I am running R version 2.7.1 on a server machine to which I am remotely connected on a Linux platform. I typed plot(trees$volume) as a test and got back the prompt with no plot in

[R] two different date formats in the same variable

2009-03-23 Thread Farrel Buchinsky
How does one convert to a date format when survey respondents have used two different date formats whilst entering their data. There were clearly told to use mm/dd/ but humans being humans some entered mm/dd/yy. There was even validity checks on the forms but I allowed them to be overridden

Re: [R] If statement generates two outputs

2009-03-23 Thread Carl Witthoft
From: Wacek Kusnierczyk Waclaw.Marcin.Kusnierczyk_at_idi.ntnu.no Date: Sun, 22 Mar 2009 22:58:49 +0100 just for fun, you could do this with multiassignment, e.g., using the (highly experimental and premature!) rvalues: source('http://miscell.googlecode.com/svn/rvalues/rvalues.r') if

Re: [R] variance/mean

2009-03-23 Thread Wacek Kusnierczyk
(this post suggests a patch to the sources, so i allow myself to divert it to r-devel) Bert Gunter wrote: x a numeric vector, matrix or data frame. y NULL (default) or a vector, matrix or data frame with compatible dimensions to x. The default is equivalent to y = x (but more efficient).

Re: [R] two different date formats in the same variable

2009-03-23 Thread jim holtman
Try using 'strsplit' to split your string on the '/' and then create a series of 'if's to determine how you want to output the new string. You will probably need this approach since you may have to check the validity and ranges of the numbers. On Mon, Mar 23, 2009 at 8:06 PM, Farrel Buchinsky

Re: [R] error statement: missing value where TRUE/FALSE needed

2009-03-23 Thread jim holtman
I would assume the expression in the 'if' is giving an NA as a result: if (NA) 1 else 2 Error in if (NA) 1 else 2 : missing value where TRUE/FALSE needed On Mon, Mar 23, 2009 at 10:38 AM, Michael Curran mp...@cam.ac.uk wrote: Hi list, I want to try Gibbs sampling as a method of estimating

[R] Summarizing each row into a frequency table

2009-03-23 Thread Daren Tan
I have a matrix containing -1, 0, 1, however certain rows will not have all 3 numbers. I have written some codes to compute the frequency table of how many -1s, 0s, 1s per row, but it is very ugly and not efficient if there are more than 3 numbers. Please suggest. m - rbind(sample(0:1, replace=T,

Re: [R] How to set up a function for Central Limit Theorem

2009-03-23 Thread j verzani
Greg Snow Greg.Snow at imail.org writes: There is also the clt.examp function in the TeachingDemos package. An interactive demo can also be found at A href=http://www.math.csi.cuny.edu/gWidgetsWWW/ex-clt.htmlhttp://www.math.csi.cuny.edu/gWidgetsWWW/ex-clt.html/A.

Re: [R] Summarizing each row into a frequency table

2009-03-23 Thread Peter Alspach
Tena koe Daren One alternative: apply(m, 1, function(x) 100*summary(factor(x, levels=-1:1))/length(x[!is.na(x)])) Doubtless there are others. HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Daren Tan

[R] A question about rJava and the classpath

2009-03-23 Thread Saptarshi Guha
Hello, Since this an R package, I'm sending the email. I'm loading all the jar files as: library(rJava) hadoop - Sys.getenv(HADOOP) allfiles - c(list.files(hadoop,pattern=jar$,full.names=T),list.files(paste(hadoop,lib,sep=.Platform$file.sep,collapse=),pattern=jar$,full.names=T)) allfiles -

  1   2   >