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
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
Try this using the builtin ts series, Nile:
year <- c(time(Nile))
Nile. <- c(Nile)
plot(year ~ Nile., type = "l")
On Thu, Feb 11, 2010 at 10:19 PM, JSmaga wrote:
>
> Hi guys,
>
> I would like to know if it is possible to switch the X Y axis when plotting
> a time series.
>
> Precisely, what I w
3 matches
Mail list logo