[R] ggplot2 and Date class

stephen sefick ssefick at gmail.com
Mon Jun 1 21:01:16 CEST 2009


The example that you have provided works fine on my end.  As far as I
know everything is up to date on my end.


Stephen Sefick

On Mon, Jun 1, 2009 at 1:20 PM, 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.
>



-- 
Stephen Sefick

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods.  We are mammals, and have not exhausted the
annoying little problems of being mammals.

								-K. Mullis




More information about the R-help mailing list