| scale_linetype_stata {ggthemes} | R Documentation |
See stata_linetype_pal for details.
scale_linetype_stata(...)
... |
common discrete scale parameters: |
Other linetype stata: stata_linetype_pal
library("reshape2") # for melt
library("plyr") # for ddply
library("ggplot2")
ecm <- melt(economics, id = "date")
rescale01 <- function(x) {(x - min(x)) / diff(range(x))}
ecm <- ddply(ecm, "variable", transform, value = rescale01(value))
ggplot(ecm, aes(x = date, y = value, linetype=variable)) +
geom_line() +
scale_linetype_stata()