I am new to R and am having trouble plotting multiple xyplots on the same graph. I have a dataframe x1 with 3 columns month, var1, var2. Month is a factor while var1 and var2 are numeric. Reading through the archives I learned to plot var1 vs month and var2 vs month and have them as two plots in one window by doing the following library(lattice) x<-xyplot(var1~month,type="b") y<-xyplot(var2~month,type="b") print(x,split(c(1,1,1,2),more=TRUE) print(y,split(c(1,2,1,2))
How do I get just one plot with month as the x axis and two lines for var1 and var2 ? thanks swami ______________________________________________ R-help@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 and provide commented, minimal, self-contained, reproducible code.