Hi
knitr::opts_chunk$set(echo = TRUE, message = FALSE, warning = FALSE)
devtools::install_github("einarhjorleifsson/ggmisc")
library(ggmisc) library(tidyverse)
read_csv("http://data.hafro.is/assmt/2018/cod/smb.csv") %>% gather(key = age, value = oU, -Year, convert = TRUE) %>% rename(year = Year) %>% mutate(yc = year - age) %>% ggplot() + geom_col(aes(year, oU, fill = factor(yc))) + scale_fill_crayola() + facet_grid(age ~ ., scale = "free_y") + theme(legend.position = "none") + scale_y_continuous(NULL, NULL) + scale_x_continuous(NULL, breaks = seq(1985, 2015, by = 5)) + labs(title = "It is the year class, stupid", subtitle = "The signal in the data is not age, not year, but yearclass")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.