[R] zoo in ggplot2

Gabor Grothendieck ggrothendieck at gmail.com
Sun Oct 19 20:09:27 CEST 2008


zoo does have plot.zoo and xyplot.zoo

library(zoo)
xyplot(d)
plot(d)

but there is no zoo method for ggplot2 currently; however,
you can qplot d from its constituent pieces:

library(ggplot2); library(zoo)
qplot(time(d), coredata(d))

On Sun, Oct 19, 2008 at 11:22 AM, stephen sefick <ssefick at gmail.com> wrote:
> library(zoo)
> d<-(structure(c(1.39981554315924, 0.89196314359498, 0.407816250252697,
> 0.823496839063978, 1.14429021220358, 1.23971035967413, 0.960868900583432,
> 0.927685306209829, 1.22072345292821, 0.249842897450642, 1.00879641624694,
> 0.925372139878243, 0.317259909172362, 0.382677149697482), index =
> structure(c(11808,
> 11869, 11961, 11992, 12084, 12173, 12265, 12418, 12600, 12631,
> 12753, 12996, 13057, 13149), class = "Date"), class = "zoo"))
>
> plot(d)
>
> is there a way to do this in ggplot?
>
> --
> Stephen Sefick
> Research Scientist
> Southeastern Natural Sciences Academy
>
> 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
>
> ______________________________________________
> 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.
>



More information about the R-help mailing list