I have a large dataset looking like this (as an example): doy<-c(178,179,180,181,182,183,184,185,186,187,188) s1<-c(0 , 0, 2.4 , 0 , 3.34 , 0 , 5.34 , 0 , 0 , 0 , 6.9) s2<-c(0 , 9.72, 0, 10.56 , 2.67 , 0 , 6.45 ,0 , 0 , 9, 3.6) dat<-cbind(doy,s1,s2) dat I need to make a barplot where the two time series s1 and s2 are plottet beside each other for each doy. How can I do that? Anette [[alternative HTML version deleted]]
On Mon, 12 Sep 2005 15:36:28 +0200 Anette N??rgaard wrote:> I have a large dataset looking like this (as an example): > > doy<-c(178,179,180,181,182,183,184,185,186,187,188) > s1<-c(0 , 0, 2.4 , 0 , 3.34 , 0 , 5.34 , 0 , 0 , 0 , 6.9) > s2<-c(0 , 9.72, 0, 10.56 , 2.67 , 0 , 6.45 ,0 , 0 , 9, 3.6) > > dat<-cbind(doy,s1,s2) > > dat > > I need to make a barplot where the two time series s1 and s2 are > plottet beside each other for each doy. How can I do that?Probably you want x <- rbind(s1, s2) colnames(x) <- doy barplot(x, beside = TRUE) or maybe barplot(t(x), beside = TRUE) hth, Z> Anette > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >
Anette N??rgaard <anette at geoplus.dk> writes:> I have a large dataset looking like this (as an example): > > doy<-c(178,179,180,181,182,183,184,185,186,187,188) > s1<-c(0 , 0, 2.4 , 0 , 3.34 , 0 , 5.34 , 0 , 0 , 0 , 6.9) > s2<-c(0 , 9.72, 0, 10.56 , 2.67 , 0 , 6.45 ,0 , 0 , 9, 3.6) > > dat<-cbind(doy,s1,s2) > > dat > > I need to make a barplot where the two time series s1 and s2 are plottet > beside each other for each doy. How can I do that?barplot(rbind(s1,s2), beside=T, names=doy) -- O__ ---- Peter Dalgaard ??ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907