nasa_10_f_bs %>%
left_join(unit, by = "unit") %>%
group_by(unit, Unit) %>%
summarise(Nobs = n()) %>%
arrange(-Nobs) %>%
{if (is_html_output()) print_table(.) else .}
unit | Unit | Nobs |
---|---|---|
MIO_NAC | Million units of national currency | 2532531 |
MIO_EUR | Million euro | 2446617 |
PC_GDP | Percentage of gross domestic product (GDP) | 2429518 |
PCH_PRE | Percentage change on previous period | 1389886 |
nasa_10_f_bs %>%
left_join(co_nco, by = "co_nco") %>%
group_by(co_nco, Co_nco) %>%
summarise(Nobs = n()) %>%
arrange(-Nobs) %>%
{if (is_html_output()) print_table(.) else .}
co_nco | Co_nco | Nobs |
---|---|---|
NCO | Non-consolidated | 4532219 |
CO | Consolidated | 4266333 |
nasa_10_f_bs %>%
left_join(finpos, by = "finpos") %>%
group_by(finpos, Finpos) %>%
summarise(Nobs = n()) %>%
arrange(-Nobs) %>%
{if (is_html_output()) print_table(.) else .}
finpos | Finpos | Nobs |
---|---|---|
ASS | Assets | 4507165 |
LIAB | Liabilities | 4291387 |
nasa_10_f_bs %>%
left_join(geo, by = "geo") %>%
group_by(geo, Geo) %>%
summarise(Nobs = n()) %>%
arrange(-Nobs) %>%
mutate(Geo = ifelse(geo == "DE", "Germany", Geo)) %>%
mutate(Flag = gsub(" ", "-", str_to_lower(Geo)),
Flag = paste0('<img src="../../bib/flags/vsmall/', Flag, '.png" alt="Flag">')) %>%
select(Flag, everything()) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}
nasa_10_f_bs %>%
filter(geo %in% c("FR", "DE"),
time == "2019",
co_nco == "CO",
na_item == "BF90",
unit == "PC_GDP") %>%
left_join(geo, by = "geo") %>%
left_join(sector, by = "sector") %>%
mutate(Geo = ifelse(geo == "DE", "Germany", Geo)) %>%
mutate(Geo = gsub(" ", "-", str_to_lower(Geo)),
Geo = paste0('<img src="../../icon/flag/vsmall/', Geo, '.png" alt="Flag">')) %>%
select(Geo, sector, Sector, values) %>%
spread(Geo, values) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}
nasa_10_f_bs %>%
filter(geo %in% c("FR", "DE"),
sector %in% c("S1", "S11", "S12", "S13", "S14_S15", "S2"),
time == "2019",
co_nco == "CO",
na_item == "BF90",
unit == "PC_GDP") %>%
left_join(geo, by = "geo") %>%
left_join(sector, by = "sector") %>%
mutate(Geo = ifelse(geo == "DE", "Germany", Geo)) %>%
mutate(Geo = gsub(" ", "-", str_to_lower(Geo)),
Geo = paste0('<img src="../../icon/flag/vsmall/', Geo, '.png" alt="Flag">')) %>%
mutate(icon = paste0('<img src="../../icon/sector/vsmall/', sector, '.png" alt="All">')) %>%
select(icon, Geo, sector, Sector, values) %>%
spread(Geo, values) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}
nasa_10_f_bs %>%
filter(geo %in% c("FR", "DE"),
sector %in% c("S11", "S12", "S13", "S14_S15"),
co_nco == "CO",
na_item == "BF90",
unit == "PC_GDP") %>%
left_join(geo, by = "geo") %>%
mutate(Geo = ifelse(geo == "DE", "Germany", Geo)) %>%
left_join(sector, by = "sector") %>%
year_to_date %>%
ggplot(.) + geom_line(aes(x = date, y = values/100, color = Geo, linetype = Sector)) +
theme_minimal() + xlab("") + ylab("% du PIB") +
scale_x_date(breaks = seq(1960, 2020, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
geom_image(data = tibble(date = rep(as.Date("1994-01-01"), 2),
value = c(1, 0.75),
image = c("~/Dropbox/icon/flag/france.png",
"~/Dropbox/icon/flag/germany.png")),
aes(x = date, y = value, image = image), asp = 1.5) +
geom_image(data = tibble(date = rep(as.Date("2020-01-01"), 6),
value = c(1.6, 0.1, -0.2, -0.5, -0.75, -.95),
image = c("~/Dropbox/icon/sector/small/S14_S15.png",
"~/Dropbox/icon/sector/small/S12.png",
"~/Dropbox/icon/sector/small/S13.png",
"~/Dropbox/icon/sector/small/S11.png",
"~/Dropbox/icon/sector/small/S13.png",
"~/Dropbox/icon/sector/small/S11.png")),
aes(x = date, y = value, image = image), asp = 1.5) +
scale_color_manual(values = c("#0055a4", "#000000")) +
scale_y_continuous(breaks = 0.01*seq(-200, 200, 20),
labels = percent_format()) +
theme(legend.position = "none")
nasa_10_f_bs %>%
filter(geo %in% c("FR", "DE", "IT", "UK"),
time == "2019",
sector == "S1",
co_nco == "CO",
finpos == "ASS",
unit == "PC_GDP") %>%
left_join(na_item, by = "na_item") %>%
left_join(geo, by = "geo") %>%
mutate(Geo = ifelse(geo == "DE", "Germany", Geo)) %>%
mutate(Geo = gsub(" ", "-", str_to_lower(Geo)),
Geo = paste0('<img src="../../icon/flag/vsmall/', Geo, '.png" alt="Flag">')) %>%
select(Geo, na_item, Na_item, values) %>%
spread(Geo, values) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}
nasa_10_f_bs %>%
filter(geo %in% c("FR", "DE", "IT", "UK"),
time == "2019",
sector == "S11",
co_nco == "CO",
finpos == "ASS",
unit == "PC_GDP") %>%
left_join(na_item, by = "na_item") %>%
left_join(geo, by = "geo") %>%
mutate(Geo = ifelse(geo == "DE", "Germany", Geo)) %>%
mutate(Geo = gsub(" ", "-", str_to_lower(Geo)),
Geo = paste0('<img src="../../icon/flag/vsmall/', Geo, '.png" alt="Flag">')) %>%
select(Geo, na_item, Na_item, values) %>%
spread(Geo, values) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}
nasa_10_f_bs %>%
filter(geo %in% c("FR", "DE", "IT", "UK"),
time == "2019",
sector == "S12",
co_nco == "CO",
finpos == "ASS",
unit == "PC_GDP") %>%
left_join(na_item, by = "na_item") %>%
left_join(geo, by = "geo") %>%
mutate(Geo = ifelse(geo == "DE", "Germany", Geo)) %>%
mutate(Geo = gsub(" ", "-", str_to_lower(Geo)),
Geo = paste0('<img src="../../icon/flag/vsmall/', Geo, '.png" alt="Flag">')) %>%
select(Geo, na_item, Na_item, values) %>%
spread(Geo, values) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}
nasa_10_f_bs %>%
filter(geo %in% c("FR", "DE", "IT", "UK"),
time == "2019",
sector == "S13",
co_nco == "CO",
finpos == "ASS",
unit == "PC_GDP") %>%
left_join(na_item, by = "na_item") %>%
left_join(geo, by = "geo") %>%
mutate(Geo = ifelse(geo == "DE", "Germany", Geo)) %>%
mutate(Geo = gsub(" ", "-", str_to_lower(Geo)),
Geo = paste0('<img src="../../icon/flag/vsmall/', Geo, '.png" alt="Flag">')) %>%
select(Geo, na_item, Na_item, values) %>%
spread(Geo, values) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}
nasa_10_f_bs %>%
filter(geo %in% c("FR", "DE", "IT", "UK"),
time == "2019",
sector == "S14_S15",
co_nco == "CO",
finpos == "ASS",
unit == "PC_GDP") %>%
left_join(na_item, by = "na_item") %>%
left_join(geo, by = "geo") %>%
mutate(Geo = ifelse(geo == "DE", "Germany", Geo)) %>%
mutate(Geo = gsub(" ", "-", str_to_lower(Geo)),
Geo = paste0('<img src="../../icon/flag/vsmall/', Geo, '.png" alt="Flag">')) %>%
select(Geo, na_item, Na_item, values) %>%
spread(Geo, values) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}
nasa_10_f_bs %>%
filter(geo %in% c("FR", "DE", "IT", "UK"),
time == "2019",
sector == "S2",
co_nco == "CO",
finpos == "ASS",
unit == "PC_GDP") %>%
left_join(na_item, by = "na_item") %>%
left_join(geo, by = "geo") %>%
mutate(Geo = ifelse(geo == "DE", "Germany", Geo)) %>%
mutate(Geo = gsub(" ", "-", str_to_lower(Geo)),
Geo = paste0('<img src="../../icon/flag/vsmall/', Geo, '.png" alt="Flag">')) %>%
select(Geo, na_item, Na_item, values) %>%
spread(Geo, values) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}