Displaying 1 result from an estimated 1 matches for "mcsm".
Did you mean:
mcs
2013 Apr 14
1
Problem plotting continuous and discrete series in ggplot with facet
...fferent variables. I would
like to combine them in one plot using facet_grid, where each variable gets
its own sub-plot. The following code resembles my data
require(ggplot2)
require(reshape2)
subm <- melt(economics, id='date', c('psavert','uempmed','unemploy'))
mcsm <- melt(data.frame(date=economics$date, q=quarters(economics$date)),
id='date')
mcsm$value <- factor(mcsm$value)
ggplot(subm, aes(date, value, col=variable, group=1)) + geom_line() +
facet_grid(variable~., scale='free_y') + geom_step(data=mcsm, aes(date,
value)) + scale_y_di...