View source: R/theme_tidybde.R
theme_tidybde | R Documentation |
A custom ggplot2 theme based on the publications of BdE.
theme_tidybde(...)
... |
Arguments passed on to
|
Theme based on ggplot2::theme_classic()
.
A ggplot2 theme()
.
ggplot2::theme_classic()
Other bde_plot:
bde_tidy_palettes()
,
scales_bde
library(ggplot2)
library(dplyr)
library(tidyr)
series_TC <- bde_series_full_load("TC_1_1.csv")
# If download was OK then plot
if (nrow(series_TC) > 0) {
series_TC <- series_TC[c(1, 2)]
series_TC_pivot <- series_TC %>%
filter(
Date >= "2020-01-01" & Date <= "2020-12-31",
!is.na(series_TC[[2]])
)
names(series_TC_pivot) <- c("x", "y")
ggplot(series_TC_pivot, aes(x = x, y = y)) +
geom_line(linewidth = 0.8, color = bde_tidy_palettes(n = 1)) +
labs(
title = "Title",
subtitle = "Some metric",
caption = "Bank of Spain"
) +
theme_tidybde()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.