scale_linetype_stata | R Documentation |
See stata_linetype_pal()
for details.
scale_linetype_stata(...)
... |
Arguments passed on to
|
Other linetype stata:
stata_linetype_pal()
require("ggplot2")
if (require("tidyr") && require("dplyr")) {
rescale01 <- function(x) {
(x - min(x)) / diff(range(x))
}
gather(economics, variable, value, -date) %>%
group_by(variable) %>%
mutate(value = rescale01(value)) %>%
ggplot(aes(x = date, y = value, linetype = variable)) +
geom_line() +
scale_linetype_stata()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.