Hi
r-help-bounces at r-project.org napsal dne 20.12.2010 11:48:51:
Hi,
I have the following problem:
I have a data.frame with 36 sample sites (colums) for which I have
covariates
in 3 categories: Area, Month and River. Each Area consists of 3 rivers,
which
were sampled over 3 month. Now I want to fuse River 1-3 for one area in
one
month. To get a data.frame with 12 colums.
I am trying to do a "for loop" (which may be a complicated solution, but
I
don't see an easier way), which is not working, apparently because
a[,ij] or a
[,c(i,j)] is not working as a definition of the matrix with a double
condition
in the colums.
How can I make it work or what would be an easier solution?
Thank you for your help,
Anne
data=data.frame(matrix(1:99,nrow=5,ncol=36))
colnames(data)=c(paste("plot",1:36))