Skip to content
Prev 59155 / 398502 Next

plot question

Apoian, Zack <Zack.Apoian <at> sac.com> writes:
There are several time series classes (ts, zoo in zoo, irts
in tseries, its in its, timeDate in fBasics) and its also possible 
to plot a numeric vector against a vector of dates.

Here is an example using zoo which also illustrates the case
where the times are not the same:


library(zoo)

# -- test data --
# y is over today and next 4 days. 
# z over today and next 9 days.
y <- zoo(11:15, Sys.Date() + 0:4)
z <- zoo(21:30, Sys.Date() + 0:9)

plot(merge(y,z), plot.type = "single", ylim = range(c(y,z)),
	col = c("green", "red"))