[R] Functions in lists or arrays?

2009-04-20 Thread Toby
and just fill in a 3 dimensional array using something like: x <- NULL dimnames(x) <- c(colnames(mat),colnames(dat), c("lbound","ubound")) ... x["RULE_NAME_1", "DATA_COL_NAME_1", "lbound"] <- ... ... But I'm not exactly sure how I woul

[R] Generalized 2D list/array/whatever?

2009-04-23 Thread Toby
l", "some other index"]] <- 3 x[["some other label", "something else"]] <- 4 I don't know the indexes/label ahead of time... they get generated... Any thoughts? -Toby. [[alternative HTML version deleted]] _

Re: [R] Generalized 2D list/array/whatever?

2009-04-23 Thread Toby
al(call(f, x, y)) } for (i in bounds) { bb <- eval(substitute(foo[,1], list(foo=as.name(i rr <- lapply(bb, dispatch2, lb, ub) } However, I don't know how to do this in a better "R" way. I think my C and pearl experience is showing through... :( -Toby. On T

[R] function for between-groups covariance matrix?

2008-04-06 Thread toby
resulting in some awkward code performing horribly on this large dataset). Thanks Toby __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

[R] nls() fails on a simple exponential fit, when lm() gets it right?

2008-08-29 Thread Toby Marthews
he same exp and ln fits using MS Excel and the numbers returned are exactly as for the 'simpler ways', so nls is definitely in the wrong, but the self-start is almost identical to the one for the logarithmic fit, which works perfectly I can't see my mistake at all. Can anyone

[R] extracting values conditonal on other values

2010-03-03 Thread Toby Gass
frame(year = gl(3, 2880, 8640, labels = c("2006", "2007", "2008")), month = gl(3, 96, 288, labels = c("1", "2", "3")), day = rep(c(21:30, 19:28, 22:31),3, each = 96), time = 100*rep(seq(, 23.75,by= .25),90), temp = runif(8640, -5, 15)

[R] Reshape

2010-09-27 Thread Toby Gass
long form: dat <- data.frame(fame = gl(4,1,10, labels = c( "18w", "16iso", "12:0", "16w")), valley = gl(2,6,10, labels = c("H", "M")), plot = gl(5, 2, 10), trt = gl(2,1,10, labels = c("e", "g")), weight = 1000*runif(10, 0

[R] Reshape

2010-09-27 Thread Toby Gass
long form: dat <- data.frame(fame = gl(4,1,10, labels = c( "18w", "16iso", "12:0", "16w")), valley = gl(2,6,10, labels = c("H", "M")), plot = gl(5, 2, 10), trt = gl(2,1,10, labels = c("e", "g")), weight = 1000*runif(

Re: [R] Reshape

2010-09-27 Thread Toby Gass
That does work, thank you. I didn't understand that the "fame" column would be the time varying column. Toby On 28 Sep 2010 at 12:47, Michael Bedward wrote: > Hi Toby, > > I think this should work... > > reshape(dat, v.names=c("weight"), idvar=c(&

[R] POSIX turns into factor

2010-10-16 Thread Toby Gass
endar" is always a factor > class(dat$calendar) [1] "factor" and I have to turn it back into a date-time object. Is this unavoidable when going back and forth from a .csv, or can I do something differently to retain the class? R 2.11.1 on Windows OS. Thank you. Toby ___

[R] Using anova() with glmmPQL()

2011-01-17 Thread Toby Marthews
didrog+state:results ): class(lmeres2)="lme" anova(object=lmeres2,test="Chisq") numDF denDF F-value p-value (Intercept)136 182.84356 <.0001 mnth 136 164.57288 <.0001 roostsitu 336 17.79263 <.0001 mnth:r

Re: [R] Statistical formulas

2011-01-18 Thread Toby Marthews
ld, but I still recommend Fowler et al. (1998) for those who are starting out with statistical testing: Fowler J, Cohen L & Jarvis P (1998). Practical statistics for field biology (2nd ed.). Wiley, Chichester, UK. Toby Marthews From: r-help-boun...@r-proje

Re: [R] Using anova() with glmmPQL()

2011-01-20 Thread Toby Marthews
t any further posts to r-sig-mixed-models. Best, Toby From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of Ben Bolker [bbol...@gmail.com] Sent: 18 January 2011 16:15 To: r-h...@stat.math.ethz.ch Subject: Re: [R] Using anova()

[R] conditional selection of dataframe rows

2010-08-12 Thread Toby Gass
the same chamber on a different day. In the full dataframe, there are, of course, many more days. Is there a handy R way to do this? Thank you for the assistance. Toby __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-h

Re: [R] conditional selection of dataframe rows

2010-08-12 Thread Toby Gass
ll the other measurements, possibly with positive values, taken on the same day. Thank you again for your efforts. Toby On 12 Aug 2010 at 14:32, Marc Schwartz wrote: > On Aug 12, 2010, at 2:24 PM, Marc Schwartz wrote: > > > On Aug 12, 2010, at 2:11 PM, Toby Gass wrote: > > >

Re: [R] conditional selection of dataframe rows

2010-08-12 Thread Toby Gass
e the toy dataframe a bit larger. Thanks again for the assistance. Toby On 12 Aug 2010 at 16:39, David Winsemius wrote: > > On Aug 12, 2010, at 4:06 PM, Toby Gass wrote: > > > Thank you all for the quick responses. So far as I've checked, > > Marc's solution

[R] syntax for batching rbind process

2010-08-18 Thread Toby Gass
ine 4. imp[i] contains only the value of the first element of test[i]; in other words, every element of imp[i] equals test[i] [1,1]. Otherwise, the script works. Could someone please enlighten me as to the correct syntax for line 4? Thank you in advance. Toby _

Re: [R] syntax for batching rbind process

2010-08-18 Thread Toby Gass
e. Thank you. Toby On 18 Aug 2010 at 13:49, Erik Iverson wrote: > > > Toby Gass wrote: > > Dear helpeRs, > > > > I am attempting to read in a series of csv files so I can bind them > > into one large dataframe. I have written the following script: &

Re: [R] syntax for batching rbind process

2010-08-18 Thread Toby Gass
It works perfectly now. Thank you all. Toby On 18 Aug 2010 at 15:04, Erik Iverson wrote: > > > Toby Gass wrote: > > Thank you for the suggestions for the more efficient code. The > > problem remains, however, that the final dataframe does not contain > > the

[R] interpreting date-related error message

2010-08-27 Thread Toby Gass
;%j" )) I get the following error message: Error in prettyNum(.Internal(format(x, trim, digits, nsmall, width, 3L, : invalid 'trim' argument .What is the error message telling me? (Windows OS and R 2.11.1) Thank you. Toby __

Re: [R] interpreting date-related error message

2010-08-27 Thread Toby Gass
Thanks to everyone for the explanations. Toby On 27 Aug 2010 at 12:46, Phil Spector wrote: > Toby - > Since dat$doy is just a number, the default S3 method > for format is used, where the second argument is the trim > parameter. I suspect you are confusing format (which is

Re: [R] leap year and order function

2011-01-31 Thread Toby Marthews
Dear All, I've always used this code: year=c(1948:1953,2000,2100,2200,2300) numdays=ifelse((year%%4==0 & year%%100!=0) | year%%400==0,366,365) > numdays [1] 366 365 365 365 366 365 366 365 365 365 Toby From: r-help-boun...@r-project.org

Re: [R] how to learn more from R

2011-02-04 Thread Toby Marthews
h lots of links for further information. Toby Marthews From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of Jie TANG [totang...@gmail.com] Sent: 04 February 2011 06:42 To: r-help@r-project.org Subject: [R] how to learn more from

Re: [R] add error bars in a plot

2011-02-09 Thread Toby Marthews
) segments(x,y-delta,x,y+delta) segments(x-barwidth,y+delta,x+barwidth,y+delta) segments(x-barwidth,y-delta,x+barwidth,y-delta) Best, Toby From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of Gerrit Eichner [gerrit.eich...@math.uni

Re: [R] Linear regressions: producing multiple outputs

2011-02-17 Thread Toby Marthews
lme. Toby From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of RTSlider [rob.t.sli...@gmail.com] Sent: 16 February 2011 18:13 To: r-help@r-project.org Subject: [R] Linear regressions: producing multiple outputs Hello all, I’m

Re: [R] barplot with errorbars

2011-02-17 Thread Toby Marthews
If you google "barplot with error bars" you immediately find http://svitsrv25.epfl.ch/R-doc/library/prada/html/barploterrbar.html . Toby. From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of Lathouri, Maria

[R] GSOC-R 2012

2011-11-18 Thread Toby Hocking
With John Nash, I am an administrator for the R project's contribution to the Google Summer of Code 2012. This is a program where Google provides $5000 to a student to write code for an open source project over a 3 month period in the summer. We would like to invite anyone interested in being ei

[R] glmulti fails because of rJava

2011-11-23 Thread Toby Marthews
. See session below for the error. I tried install.packages(rJava) as advised by the error report but it didn't help (see session below). Any advice would be much appreciated: I can now not use glmulti at all and I can't see how to solve this! Thank you very much R Help!

[R] Constructing groupedData objects in nlme - a little problem

2008-06-04 Thread Toby Marthews
g the structure properly even though the formula and data values are all correct. Can anyone help? I've looked at the ?groupedData man page, but it has no solution to this. Thanks very much for any advice, Toby Pinheiro JC & Bates DM (2000). Mixed-Effects Models in S and S-PLUS (1st ed

[R] Word wrapping for character objects (WINDOWS R ONLY)

2008-06-11 Thread Toby Marthews
I get word wrapping like this in Windows? Perhaps the attached screenshots clarify this question. THANKS FOR ANY HELP! Toby Marthews Previous relevant posts: - The post from 2006 about Screen Wrapping (http://tolstoy.newcastle.edu.au/R/help/06/05/26673.html) which Brian Ripley answered was a

Re: [R] controlling location of labels in axis()

2008-06-12 Thread Toby Marthews
quot;First outer y axis label",side=2,outer=TRUE) mtext("Second outer x axis label",side=3,outer=TRUE) mtext("Second outer y axis label",side=4,outer=TRUE) Cheers, Toby Marthews Le Jeu 12 juin 2008 15:32, Andrew Yee a écrit : > Here's a naive question about axis() >

Re: [R] Level Plot and Scale of Colorkey

2008-06-13 Thread Toby Marthews
Try colscaledivs=100#colscaledivs=15 here is the R default levelplot(z ~ x * y, g,xlab="x co-ordinate",ylab="y co-ordinate",colorkey=TRUE,at=seq(from=-0.01,to=0.25,length=colscaledivs),col.regions=(col=gray((0:colscaledivs)/colscaledivs))) Toby Marthews Le

Re: [R] round(1.5) = round(2.5) = 2?

2008-06-15 Thread Toby Marthews
a bit odd. However, R's benefits and advantages by far outweigh its little oddities, as I presume you know since you are using it. Effectively, I never use the round() command and always calculate using the floor function. Toby Marthews Le Dim 15 juin 2008 11:26, Markus Didion a écrit :

[R] How can I stop strwrap removing escape characters? (and solution to the screen wrapping question from 11/6)

2008-06-16 Thread Toby Marthews
t;\n\tHello.\n") Hello. > Is there any way to prevent strwrap doing this? I haven't found any options for this. Thanks very much (and thanks to Greg Snow for the tip about strwrap before). Toby Marthews == Le Mer 11 juin 2008 18:00, Gre

Re: [R] Calling functions

2008-06-17 Thread Toby Marthews
orkspace loaded? Toby Marthews Le Mar 17 juin 2008 13:32, Michael Pearmain a écrit : > Another newbie question. > > I've written a function and saved the file as Xtabs.R, in a central place > on > a network so others will be able ot use the function, > My question is how do i

r-help@r-project.org

2008-06-18 Thread Toby Marthews
logical OR. The shorter form performs elementwise comparisons in much the same way as arithmetic operators. The longer form evaluates left to right examining only the first element of each vector. Evaluation proceeds only until the result is determined." Hope this helps, Toby Marthews L

[R] Error message: Bad value

2008-06-24 Thread Toby Gass
tml I do not need a response, unless there is a preventative measure, but thought I would bring this to your attention. Thank you, Toby Toby Gass Graduate Degree Program in Ecology Department of Forest, Rangeland, and Watershed Stewardship Warner College of Natural Resources Colorado State Univers

Re: [R] Error message: Bad value

2008-06-24 Thread Toby Gass
problem in the past year. Toby - Original Message - From: "Duncan Murdoch" <[EMAIL PROTECTED]> To: "Toby Gass" <[EMAIL PROTECTED]> Cc: Sent: Tuesday, June 24, 2008 6:27 PM Subject: Re: [R] Error message: Bad value | On 24/06/2008 3:12 PM, Toby Gass wrote:

[R] nested time series data with measurement error

2008-04-23 Thread Toby Gass
t;trt",1:2)) pre.post <- gl(2,9,length = 108, label = c("pre","post")) response <- runif(108, min = -28, max = -25) help <- data.frame(tree,month,trtmt,pre.post, response) Thank you in advance for your assistance. Toby Gass Graduate Degree Program in Ecolog