Hello,
I forgot a third possibility
plot(as.ts(cbind(x, y)), plot.type = "single", col = 1:2)
Rui Barradas
Em 04-05-2013 10:37, Rui Barradas escreveu:
Hello,
Where is the reproducible example? See
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
Anyway, see if this does what you need.
set.seed(1)
x <- cumsum(rnorm(100))
y <- cumsum(rnorm(100))
ylm <- range(c(x, y))
plot(as.ts(x), ylim = ylm)
lines(y, col = "blue")
# Or in one instruction
matplot(cbind(x, y), type = "l")
Hope this helps,
Rui Barradas
Em 04-05-2013 10:21, Preetam Pal escreveu:
Hi all,
I have 2 time series variables : X_t and Y_t where t=0,1,2,.......,100
I want a plot containing the line charts( time plotted on the x-axis) for
both these variables.
______________________________________________
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.
______________________________________________
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.