Assuming that you are using the xts package, try this:

 data(sample_matrix)
 sample.xts <- as.xts(sample_matrix)
 open <- as.vector(sample.xts[,1])
 month <- as.Date(time(sample.xts))
 plot(open, month, type="l")

 -Peter Ehlers

JSmaga wrote:
Basically it works, but I use the xts format and the axis are messed up.

plot(c(time(ser)) ~ c(ser), type = "l")
Error in as.POSIXct.default(x) : do not know how to convert 'x' to class "POSIXlt"

I don't know why do you have any idea?

Besides, why do you use the c(...) function in your code ?

And finally, i am not used to the ~ operator and the R doc did not help me,
could you tell me what it does?

Sorry for all the questions...

Jeremie

______________________________________________
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.

Reply via email to