Re: [R] Name assignment in for loop

2012-11-10 Thread nrm2010
o name the elements and then >address the list using these names as I find that less error prone and more >informative. > >HTH > >Peter Alspach > >-Original Message----- >From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On >B

[R] Name assignment in for loop

2012-11-01 Thread nrm2010
Dear helpeRs- I'm using a for loop to create a series of models. I'm trying to assign a name to each model created, using the loop index. The loop gets stuck at the name of the model, giving the error "target of assignment expands to non-language object". The linear model runs without er

Re: [R] reshape

2012-06-21 Thread nrm2010
Tair.T1 = rnorm(40), Tair.T2 = rnorm(40)) > > x <- melt(toy, id = c('year', 'month', 'day', 'hhmm', 'plot', 'trt')) > > # parse the type, group and number > x$type <- sub("\..*$", "", x$vari

Re: [R] reshape

2012-06-20 Thread nrm2010
=c(rep("B",80),rep("T",80)), > Subject=c(rep(1,40),rep(2,40),rep(1,40),rep(2,40))) > toynewTair<-data.frame(dat3,toymelt2) > > Hope this helps. > > A.K. > > > > - Original Message - > From: nrm2010 > To: r-help &

Re: [R] reshape

2012-06-20 Thread nrm2010
1 2 1100 T 2 0.255978008 0.0604626563 > 16 2007 1 2 1101 B 1 -0.479254067 0.7770438119 > 17 2007 1 2 1101 B 2 0.526466448 -0.1691557783 > 18 2007 1 2 1101 T 1 2.070198634 0.1129769772 > 19 2007 1 2 1101 T 10

Re: [R] reshape

2012-06-20 Thread nrm2010
4 VWC.B1 -0.01787670 VWC B 1 >3 2007 1 2 1100 1 4 VWC.B1 -0.07361414 VWC B 1 >4 2007 1 2 1101 1 4 VWC.B1 0.90117558 VWC B 1 >5 2007 2 1 1100 1 4 VWC.B1 0.64824677 VWC B 1 >6 2007 2 1 1101 1 4 VWC.B1 0.26769079 VWC B 1 >> > > >On Wed, Jun 20, 2012 at 12:08 PM, nrm2

[R] reshape

2012-06-20 Thread nrm2010
Hello, helpeRs, I am attempting to reshape (either base R or package reshape) multiple .csv spreadsheets from a very unfortunate wide format to long format.  Each spreadsheet looks something like this, after being read in to R: toy <- data.frame(year = rep(2007:2008,each = 20), month = rep(1:5

[R] Basic NLME syntax

2011-02-23 Thread nrm2010
Hello, I'm trying to use NLME for a non-linear model with one random effect that is the same as the one grouping level (chamber). Using the following statement: test <- nlme(flux ~ b0 * exp((b1*soiltemp) - (b2*soiltemp^2)) * vpd^b3 * mstsoil2^b4 * airtemp^b5, data = ac5, fixed = list(b0 + b1 + b