anne-chr.afs at web.de
Mon Dec 20 11:48:51 CET 2010
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,
for(i in 1:length(levels(factor(cov$Month))))
for(j in 1:length(levels(factor(cov$Area))))
More information about the R-help