I would like to graph cumulative counts and use tapply(...,cumsum) to get the cumulative counts. For instance: library(lattice) t<-rep(1:4,each=3) #time i<-rep(1:3,times=4) #categories n<-rpois(length(t),t) #count xyplot(n ~ t,groups=i, type="o",key=simpleKey(as.character(1:3),x=0,y=1,lines=T)) N<-tapply(n,t,cumsum)
Now, what is the best way to convert N to a vector that can be plotted? E.g. xyplot(N ~ t,groups=i, type="o",key=simpleKey(as.character(1:3),x=0,y=1,lines=T)) Or is there a better way to get cumulative graphs? Thanks, Gerrit. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.