After succeeding (with your help) in plotting meteo variables in single (one variable) graphs I\'m trying to produce a panel with time series of the different variables in my da
the issue is twofold. First of all there's no date
object within the melted data.frame
, which gives you the error message. Second, your FECHA.H_SOLAR
is a factor which would make hard plotting the dates correctely. So here is my solution:
datos <- source("http://ubuntuone.com/42j1RqUmNmxUuCppW4gElX")[[1]]
library(reshape2)
library(ggplot2)
datos$PRECIP[is.na(datos$PRECIP)] <- 0
dm <- melt(datos,id="FECHA.H_SOLAR")
# change FECHA.H_SOLAR to POSIXct so you get your dates right
dm$Fecha <- as.POSIXct(dm$FECHA.H_SOLAR, "%y/%m/%d %H:%M:%S", tz = "")
qplot(Fecha, value, data = dm, geom = "line", group = variable) +
facet_grid(variable ~ ., scale = "free_y")
Hope it Helps