ggplot2 - time series in R -
here question:
have these data
summary(data) date 1990/01: 1 1990/02: 1 1990/03: 1 1990/04: 1 1990/05: 1 1990/06: 1 (other):242 attribute min. :164.9 1st qu.:201.5 median :244.1 mean :274.6 3rd qu.:313.3 max. :512.1 na's : 1.0
and want draw time series plot
so tried this:
qplot(as.date(date, "%y/%m/%d"), attribute, data = data, geom = "line", main="attribute per month 1990-2010", xlab="month-year", ylab="attribute" , colour = i("steelblue4"),fill = i("steelblue4"))
and got:
error in seq.int(r1$year, to$year, by) : 'from' must finite
in addition: warning messages:
1: in min(x) : no non-missing arguments min; returning inf
2: in max(x) : no non-missing arguments max; returning -inf
any ideas solve it?
thank you
this conversion as.date(date, "%y/%m/%d")
gives na
values.
try as.date(paste(date,"01",sep="/"), "%y/%m/%d")
.
Comments
Post a Comment