[R] ggplot2 and Date class

hadley wickham h.wickham at gmail.com
Mon Jun 1 21:02:01 CEST 2009


You might have an out-of-date version of the plyr package - try
install.packages("plyr")

Hadley

On Mon, Jun 1, 2009 at 10:20 AM, Matt Frost <mwfrost at gmail.com> wrote:
> I'm trying to plot a time series in ggplot, but a date column in my
> data frame is causing errors. Rather than provide my own data, I'll
> just refer to the scale_date example at:
> http://had.co.nz/ggplot2/scale_date.html
> , which reproduces the error.
>
>> df <- data.frame( date = seq(Sys.Date(), len=100, by="1 day")[sample(100, 50)], price = runif(50) )
>> dt <- qplot(date, price, data=df, geom="line") + opts(aspect.ratio = 1/4)
>> dt + scale_x_date()
>
> Error in aesdefaults(data, .$geom$default_aes(), compact(.$mapping)) :
> could not find function "as_df"
>
> My ggplot2 package is up to date. Am I missing something else, maybe
> in my default aesthetics?
>
> Thanks,
> Matt Frost
>
> ______________________________________________
> R-help at 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.
>



-- 
http://had.co.nz/




More information about the R-help mailing list