Code
%>%
log left_join(variable, by = "variable") %>%
group_by(variable, Variable) %>%
summarise(Nobs = n()) %>%
arrange(-Nobs) %>%
if (is_html_output()) datatable(., filter = 'top', rownames = F) else .} {
Data - Fred
%>%
log left_join(variable, by = "variable") %>%
group_by(variable, Variable) %>%
summarise(Nobs = n()) %>%
arrange(-Nobs) %>%
if (is_html_output()) datatable(., filter = 'top', rownames = F) else .} {
<- log %>%
plot_linear filter(date >= as.Date("1996-05-01"),
%in% c("HPIPONM226S", "AHETPI")) %>%
variable left_join(variable, by = "variable") %>%
group_by(Variable) %>%
mutate(value = 100*value/value[1]) %>%
ggplot(.) + theme_minimal() + xlab("") + ylab("") +
geom_line(aes(x = date, y = value, color = Variable)) +
theme(legend.position = c(0.4, 0.90),
legend.title = element_blank()) +
scale_x_date(breaks = seq(1700, 2025, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%Y")) +
scale_y_continuous(breaks = seq(100, 400, 50))
plot_linear
<- plot_linear +
plot_log scale_y_log10(breaks = seq(100, 400, 50))
plot_log
::ggarrange(plot_linear + ggtitle("Linear scale"), plot_log + ggtitle("Log scale"), common.legend = T) ggpubr