here is my question:
i 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 i want to draw a time series plot
so i 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 i got:
Error in seq.int(r1$year, to$year, by) : 'from' must be finite
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
any ideas to solve it?
thank you
This conversion as.Date(Date, "%Y/%m/%d") gives you NA for all values.
Try as.Date(paste(Date,"01",sep="/"), "%Y/%m/%d").
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With