[R] Date classes in ggplot2

hadley wickham h.wickham at gmail.com
Sun Oct 19 18:01:46 CEST 2008


On Sun, Oct 19, 2008 at 10:49 AM, stephen sefick <ssefick at gmail.com> wrote:
> updn.gg <- (structure(list(date = structure(c(11808, 11869, 11961, 11992,
> 12084, 12173, 12265, 12418, 12600, 12631, 12753, 12996, 13057,
> 13149), class = "Date"), unrestored = c(1.13789418691602, 0.704948049842955,
> 0.276777348238899, 0.417586861554189, 0.504870337754768, 0.673201771716216,
> 0.560704221510771, 0.835737007551542, 1.10773858390693, 0.197070828834836,
> 0.942350681588179, 0.950447141061461, 0.246637790002705, 0.324035567509960
> ), restored = 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)), .Names = c("date",
> "unrestored", "restored"), row.names = c(NA, -14L), class = "data.frame"))
>
> #I would like to do this in ggplot
> xyplot(unrestored+restored~date, data=updn.gg, type=c("l"), auto.key=TRUE)
> #this is what I have tried and get an error message
> melt.updn <- melt(updn.gg, id.var="date")

What error message?  It works for me.

Hadley

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



More information about the R-help mailing list