[R] RES: another aov results interpretation question
Paulo Brando
pmbrando at ipam.org.br
Mon Jun 20 06:46:15 CEST 2005
Dear All,
I created a script to calculate averages - two groups: "parcel" and
"date" - and, based on these averages, make a graph. The problem is that
'R' does not recognize the first column even if I try to insert one.
A brief example
Raw data:
Data <- sample(1:100, 30, replace = FALSE, prob = NULL)
Date <- rep(c("02/30/2004","03/15/2004", "04/16/2004", "06/14/2004",
"07/08/2004"), 6)
Parcel <- rep(c("DRY", "CONTROL"),15)
Df <- data.frame(Parcel, Date, Data)
Res <- tapply(Df$Data, list(Date = Df$Date, Parcel = Df$Parcel), mean)
> Res
Parcel
Date CONTROL DRY
02/30/2004 53.00000 52.33333
03/15/2004 54.00000 67.66667
04/16/2004 54.66667 30.00000
06/14/2004 27.66667 20.00000
07/08/2004 59.00000 38.00000
> colnames(Res)
[1] "CONTROL" "DRY"
> matplot(Res[,1], Res[,-1], type = "l")
### It does not recognize the colunm "Date". Why?
Thanks in advance!
Paulo
________________________________________
Paulo M. Brando
Instituto de Pesquisa Ambiental da Amazonia (IPAM)
Santarem, PA, Brasil.
Av. Rui Barbosa, 136.
Fone: + 55 93 522 55 38
www.ipam.org.br
E-mail: pmbrando at ipam.org.br
More information about the R-help
mailing list