Skip to content
Prev 169165 / 398503 Next

overlaying plots from a list of data frames

Create a zoo object z and plot it:

library(zoo)
f <- function(x) zoo(x$data, levels(x$year)[x$year])
z <- do.call(merge, lapply(foo, f))
plot(z, screen = 1, col = 1:6, pch = 1:6, type = "o",
	ylab = "data", xlab = "year")
legend("topright", legend = 1:6, lty = 1, pch = 1:6, col = 1:6)

See ?plot.zoo and the 3 zoo vignettes (pdf documents) in zoo package.
On Tue, Feb 3, 2009 at 4:54 PM, Timothy W. Hilton <twh142 at psu.edu> wrote: