[R] change column names of several data frames

2008-04-21 Thread Henrik Parn
Dear all, I have several data frames for which I want to change the column names. Example data: data.1 <- data.frame(x1 = rnorm(5)) data.2 <- data.frame(x1 = rnorm(5)) . . What I want to achieve: names(data.1) <- "y1" names(data.1) <- "y1" . . Is it possible to achieve this with a loop or any

[R] [Fwd: Re: subsetting]

2007-10-26 Thread henrik . parn
Sorry that I was unclear. For an individual to qualify for my analysis I want both of the following two criteria to be fulfilled: First, I want to select measurement taken at a certain age: for the focal individual the year of measurement (year) should be the same as year.hatch Second, I want th

[R] subsetting

2007-10-25 Thread henrik . parn
Dear all, I have received some data on birds that looks sth like this: # a unique id for each individual id <- c(1,1,1,2,2,2,3,3,3,4,4,5,6) # the year the bird was measured year <- c(1995, 1996, 1997, 1995, 1996, 1997, 1996, 1997, 1998, 1996, 1997, 1997, 1998) # the year the bird was hatched y