library(ggplot2)
ggplot(heights,
aes(x = year,
y = height_cm,
group = country)) +
geom_line() +
facet_strata()
ggplot(heights,
aes(x = year,
y = height_cm,
group = country)) +
geom_line() +
facet_wrap(~continent)
ggplot(heights,
aes(x = year,
y = height_cm,
group = country)) +
geom_line() +
facet_strata(along = year)
# \donttest{
library(dplyr)
heights %>%
key_slope(height_cm ~ year) %>%
right_join(heights, ., by = "country") %>%
ggplot(aes(x = year,
y = height_cm)) +
geom_line(aes(group = country)) +
geom_smooth(method = "lm") +
facet_strata(along = .slope_year)
# }
Run the code above in your browser using DataLab