Skip to content

Commit

Permalink
updates (see details in comment)
Browse files Browse the repository at this point in the history
- Include Fig 2 text for the US
- Correct Fig 4 title for TL3 countries
- Change Fig 4 font type to "sans/Arial" (mono, serif are other possible options)
- Change Fig 4 title position
- Change Fig 2 font for CHL
- Manually adjust KOR and JPN (exclude Fig 3 and 4)
- Manually adjust SVK (no overview and final tables)
  • Loading branch information
Taina.SOUZAPACHECO committed Oct 24, 2023
1 parent 6bd2fd5 commit 6eb90d7
Show file tree
Hide file tree
Showing 66 changed files with 715 additions and 703 deletions.
15 changes: 14 additions & 1 deletion 00_country_template_tl3.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -900,9 +900,22 @@ text_all <- dp2 %>%

```{r fig4_2}
# put fig4 title in black
title_fig4 <- if (any(ctry %in% c("USA", "TUR", "NOR", "CHE", "IRL"))) {
"Figure 4: Share of workers in most productive (tradable) sectors, \nTL2 regions"
} else {
"Figure 4: Share of workers in most productive (tradable) sectors, \nTL3 regions"
}
# https://stackoverflow.com/questions/34610165/what-is-the-default-font-for-ggplot2
# https://plotly.com/r/reference/layout/
fig4 <- fig4 %>%
layout(
title = list(text = "Figure 4: Share of workers in most productive (tradable) sectors, TL2 regions", x = 0, font = list(color = "black"))
title = list(text = title_fig4,
x = 0,
xanchor = "left",
xref = "paper",
font = list(color = "black", family = "Arial"))
)
# remove legend background
Expand Down
12 changes: 6 additions & 6 deletions docs/index.html

Large diffs are not rendered by default.

52 changes: 26 additions & 26 deletions docs/search.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions docs/tl0-irl.html

Large diffs are not rendered by default.

22 changes: 14 additions & 8 deletions docs/tl0-usa.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/tl2-can.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/tl2-chl.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/tl2-mex.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-aut.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-bel.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-che.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-cze.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-deu.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-dnk.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-esp.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-est.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-fin.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-fra.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-gbr.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-grc.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-hun.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-ita.html

Large diffs are not rendered by default.

26 changes: 4 additions & 22 deletions docs/tl3-jpn.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-ltu.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-lva.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-nld.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-nor.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-nzl.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-pol.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-prt.html

Large diffs are not rendered by default.

32 changes: 9 additions & 23 deletions docs/tl3-svk.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-svn.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-swe.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/tl3-tur.html

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,10 @@ text_all <- dp2 %>%
# put fig3 title in black
fig3 <- fig3 %>%
layout(
title = list(text = "Figure 3: Share of workers in most productive (tradable) sectors,\nTL2 regions", x = 0, font = list(color = "black"))
title = list(text = "Figure 3: Share of workers in most productive (tradable) sectors,\nTL2 regions", x = 0,
xanchor = "left",
xref = "paper",
font = list(color = "black", family = "Arial"))
)
# remove legend background
Expand Down
6 changes: 5 additions & 1 deletion tl0-irl.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,11 @@ fig2 <- subplot(p1, p2, nrows = 1, margin = 0.05, shareX = TRUE, shareY = TRUE)
fig2 <- fig2 %>%
layout(
title = list(text = "Figure 2: Share of workers in most productive (tradable) sectors,\nTL2 regions", x = 0),
title = list(text = "Figure 2: Share of workers in most productive (tradable) sectors,\nTL2 regions",
x = 0,
xanchor = "left",
xref = "paper",
font = list(color = "black", family = "Arial")),
margin = list(
l = 50, r = 50,
b = 50, t = 120,
Expand Down
26 changes: 25 additions & 1 deletion tl0-usa.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,26 @@ gdp_3_gap_txt <- ifelse(gdp_5_gap - gdp_5_gap_lag > 0, "increase", "decrease")
gdp_3_gap_pct <- abs(round(gdp_5_gap - gdp_5_gap_lag, 3))
```

```{r next paragraph}
next_paragraph <- if (any(ctry %in% c("LTU", "EST", "FIN", "LVA", "NZL", "NOR", "SVK", "SVN", "CHE"))) {
glue("There is no data for the gap in GDP per capita between large metropolitan and non-large metropolitan regions for 2000 and 2020.")
} else {
glue("In 2020, the gap in GDP per capita between large metropolitan and non-large metropolitan regions was { gdp_gap }. For reference, the same value for OECD was { gdp_2_gap }. This gap { gdp_gap_txt } by { gdp_gap_pct } percentage points between 2000 and 2020.")
}
last_paragraph <- if (any(ctry %in% c("KOR", "NLD"))) {
glue("There is no data for the gap in GDP per capita between regions near and far a Functional Urban Area (FUA) of more than 250 thousand inhabitants for 2000 and 2020.")
} else {
glue("In turn, the gap in GDP per capita between regions near and far a Functional Urban Area (FUA) of more than 250 thousand inhabitants was { gdp_5_gap } in 2020 and { gdp_3_gap_txt } by { gdp_3_gap_pct} percentage points since 2000.")
}
```

`r next_paragraph`

Meanwhile, in 2020, the gap in GDP per capita between metropolitan and non-metropolitan regions was `r gdp_3_gap`. For reference, the same value for OECD was `r gdp_4_gap`. This gap `r paste(gdp_2_gap_txt, "by", gdp_2_gap_pct)` percentage points since 2000.

`r last_paragraph`

```{r usa_fig2_3}
# no interactivity
# fig2
Expand Down Expand Up @@ -904,7 +924,11 @@ text_all <- dp2 %>%
# put fig4 title in black
fig4 <- fig4 %>%
layout(
title = list(text = "Figure 4: Share of workers in most productive (tradable) sectors,\nTL2 regions", x = 0, font = list(color = "black"))
title = list(text = "Figure 4: Share of workers in most productive (tradable) sectors,\nTL2 regions",
x = 0,
xanchor = "left",
xref = "paper",
font = list(color = "black", family = "Arial"))
)
# remove legend background
Expand Down
6 changes: 5 additions & 1 deletion tl2-can.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,11 @@ text_all <- dp2 %>%
# put fig3 title in black
fig3 <- fig3 %>%
layout(
title = list(text = "Figure 3: Share of workers in most productive (tradable) sectors,\nTL2 regions", x = 0, font = list(color = "black"))
title = list(text = "Figure 3: Share of workers in most productive (tradable) sectors,\nTL2 regions",
x = 0,
xanchor = "left",
xref = "paper",
font = list(color = "black", family = "Arial"))
)
# remove legend background
Expand Down
38 changes: 35 additions & 3 deletions tl2-chl.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,30 @@ hpdiff <- hpgrew - lpgrew
hpmore <- ifelse(hpdiff > 0, "more", "less")
# fig2 <- dp11 %>%
# rename(
# value = value_country,
# series = name
# ) %>%
# ggplot() +
# geom_line(aes(x = time, y = value, color = series), linewidth = 1.2) +
# # theme_oecd(base_size = 10) +
# theme_minimal() +
# scale_colour_manual(values = c("#177dc7","#508551")) +
# labs(
# x = "", y = "Labour productivity (2015 USD PPP)", colour = "",
# title = "Figure 2: Evolution of labour productivity, TL2 regions"
# ) +
# scale_x_continuous(labels = as.character(yrs), breaks = yrs) +
# scale_y_continuous(labels = scales::number_format())+
# theme(title = element_text(family = "serif")) # windowsFonts()
fig3_title <- if (any(ctry %in% c("USA", "TUR", "NOR", "CHE", "CHL"))) {
"Figure 2: Evolution of labour productivity,\nTL2 regions"
} else {
"Figure 2: Evolution of labour productivity,\nTL2 regions"
}
fig2 <- dp11 %>%
rename(
value = value_country,
Expand All @@ -399,15 +423,19 @@ fig2 <- dp11 %>%
ggplot() +
geom_line(aes(x = time, y = value, color = series), linewidth = 1.2) +
# theme_oecd(base_size = 10) +
# theme(plot.title = element_text(size = 13, hjust = 0, margin = margin(0, 0, 10, 0))) +
theme_minimal() +
scale_colour_manual(values = c("#177dc7","#508551")) +
# scale_colour_manual(values = clrs3[1:2]) +
scale_colour_manual(values = c("#508551", "#177dc7")) +
labs(
x = "", y = "Labour productivity (2015 USD PPP)", colour = "",
title = "Figure 2: Evolution of labour productivity, TL2 regions"
title = fig3_title
) +
scale_x_continuous(labels = as.character(yrs), breaks = yrs) +
scale_y_continuous(labels = scales::number_format())
ctry3 <- if (any(ctry %in% c("USA", "GBR", "CZE", "SVK", "NLD"))) {
paste("The", ctry2)
} else {
Expand Down Expand Up @@ -700,7 +728,11 @@ text_all <- dp2 %>%
# put fig3 title in black
fig3 <- fig3 %>%
layout(
title = list(text = "Figure 3: Share of workers in most productive (tradable) sectors,\nTL2 regions", x = 0, font = list(color = "black"))
title = list(text = "Figure 3: Share of workers in most productive (tradable) sectors,\nTL2 regions",
x = 0,
xanchor = "left",
xref = "paper",
font = list(color = "black", family = "Arial"))
)
# remove legend background
Expand Down
5 changes: 4 additions & 1 deletion tl2-mex.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,10 @@ text_all <- dp2 %>%
# put fig3 title in black
fig3 <- fig3 %>%
layout(
title = list(text = "Figure 3: Share of workers in most productive (tradable) sectors,\nTL2 regions", x = 0, font = list(color = "black"))
title = list(text = "Figure 3: Share of workers in most productive (tradable) sectors,\nTL2 regions", x = 0,
xanchor = "left",
xref = "paper",
font = list(color = "black", family = "Arial"))
)
# remove legend background
Expand Down
15 changes: 14 additions & 1 deletion tl3-aut.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,22 @@ text_all <- dp2 %>%

```{r aut_fig4_2}
# put fig4 title in black
title_fig4 <- if (any(ctry %in% c("USA", "TUR", "NOR", "CHE", "IRL"))) {
"Figure 4: Share of workers in most productive (tradable) sectors, \nTL2 regions"
} else {
"Figure 4: Share of workers in most productive (tradable) sectors, \nTL3 regions"
}
# https://stackoverflow.com/questions/34610165/what-is-the-default-font-for-ggplot2
# https://plotly.com/r/reference/layout/
fig4 <- fig4 %>%
layout(
title = list(text = "Figure 4: Share of workers in most productive (tradable) sectors, TL2 regions", x = 0, font = list(color = "black"))
title = list(text = title_fig4,
x = 0,
xanchor = "left",
xref = "paper",
font = list(color = "black", family = "Arial"))
)
# remove legend background
Expand Down
15 changes: 14 additions & 1 deletion tl3-bel.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,22 @@ text_all <- dp2 %>%

```{r bel_fig4_2}
# put fig4 title in black
title_fig4 <- if (any(ctry %in% c("USA", "TUR", "NOR", "CHE", "IRL"))) {
"Figure 4: Share of workers in most productive (tradable) sectors, \nTL2 regions"
} else {
"Figure 4: Share of workers in most productive (tradable) sectors, \nTL3 regions"
}
# https://stackoverflow.com/questions/34610165/what-is-the-default-font-for-ggplot2
# https://plotly.com/r/reference/layout/
fig4 <- fig4 %>%
layout(
title = list(text = "Figure 4: Share of workers in most productive (tradable) sectors, TL2 regions", x = 0, font = list(color = "black"))
title = list(text = title_fig4,
x = 0,
xanchor = "left",
xref = "paper",
font = list(color = "black", family = "Arial"))
)
# remove legend background
Expand Down
15 changes: 14 additions & 1 deletion tl3-che.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,22 @@ text_all <- dp2 %>%

```{r che_fig4_2}
# put fig4 title in black
title_fig4 <- if (any(ctry %in% c("USA", "TUR", "NOR", "CHE", "IRL"))) {
"Figure 4: Share of workers in most productive (tradable) sectors, \nTL2 regions"
} else {
"Figure 4: Share of workers in most productive (tradable) sectors, \nTL3 regions"
}
# https://stackoverflow.com/questions/34610165/what-is-the-default-font-for-ggplot2
# https://plotly.com/r/reference/layout/
fig4 <- fig4 %>%
layout(
title = list(text = "Figure 4: Share of workers in most productive (tradable) sectors, TL2 regions", x = 0, font = list(color = "black"))
title = list(text = title_fig4,
x = 0,
xanchor = "left",
xref = "paper",
font = list(color = "black", family = "Arial"))
)
# remove legend background
Expand Down
15 changes: 14 additions & 1 deletion tl3-cze.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,22 @@ text_all <- dp2 %>%

```{r cze_fig4_2}
# put fig4 title in black
title_fig4 <- if (any(ctry %in% c("USA", "TUR", "NOR", "CHE", "IRL"))) {
"Figure 4: Share of workers in most productive (tradable) sectors, \nTL2 regions"
} else {
"Figure 4: Share of workers in most productive (tradable) sectors, \nTL3 regions"
}
# https://stackoverflow.com/questions/34610165/what-is-the-default-font-for-ggplot2
# https://plotly.com/r/reference/layout/
fig4 <- fig4 %>%
layout(
title = list(text = "Figure 4: Share of workers in most productive (tradable) sectors, TL2 regions", x = 0, font = list(color = "black"))
title = list(text = title_fig4,
x = 0,
xanchor = "left",
xref = "paper",
font = list(color = "black", family = "Arial"))
)
# remove legend background
Expand Down
15 changes: 14 additions & 1 deletion tl3-deu.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,22 @@ text_all <- dp2 %>%

```{r deu_fig4_2}
# put fig4 title in black
title_fig4 <- if (any(ctry %in% c("USA", "TUR", "NOR", "CHE", "IRL"))) {
"Figure 4: Share of workers in most productive (tradable) sectors, \nTL2 regions"
} else {
"Figure 4: Share of workers in most productive (tradable) sectors, \nTL3 regions"
}
# https://stackoverflow.com/questions/34610165/what-is-the-default-font-for-ggplot2
# https://plotly.com/r/reference/layout/
fig4 <- fig4 %>%
layout(
title = list(text = "Figure 4: Share of workers in most productive (tradable) sectors, TL2 regions", x = 0, font = list(color = "black"))
title = list(text = title_fig4,
x = 0,
xanchor = "left",
xref = "paper",
font = list(color = "black", family = "Arial"))
)
# remove legend background
Expand Down
15 changes: 14 additions & 1 deletion tl3-dnk.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,22 @@ text_all <- dp2 %>%

```{r dnk_fig4_2}
# put fig4 title in black
title_fig4 <- if (any(ctry %in% c("USA", "TUR", "NOR", "CHE", "IRL"))) {
"Figure 4: Share of workers in most productive (tradable) sectors, \nTL2 regions"
} else {
"Figure 4: Share of workers in most productive (tradable) sectors, \nTL3 regions"
}
# https://stackoverflow.com/questions/34610165/what-is-the-default-font-for-ggplot2
# https://plotly.com/r/reference/layout/
fig4 <- fig4 %>%
layout(
title = list(text = "Figure 4: Share of workers in most productive (tradable) sectors, TL2 regions", x = 0, font = list(color = "black"))
title = list(text = title_fig4,
x = 0,
xanchor = "left",
xref = "paper",
font = list(color = "black", family = "Arial"))
)
# remove legend background
Expand Down
15 changes: 14 additions & 1 deletion tl3-esp.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,22 @@ text_all <- dp2 %>%

```{r esp_fig4_2}
# put fig4 title in black
title_fig4 <- if (any(ctry %in% c("USA", "TUR", "NOR", "CHE", "IRL"))) {
"Figure 4: Share of workers in most productive (tradable) sectors, \nTL2 regions"
} else {
"Figure 4: Share of workers in most productive (tradable) sectors, \nTL3 regions"
}
# https://stackoverflow.com/questions/34610165/what-is-the-default-font-for-ggplot2
# https://plotly.com/r/reference/layout/
fig4 <- fig4 %>%
layout(
title = list(text = "Figure 4: Share of workers in most productive (tradable) sectors, TL2 regions", x = 0, font = list(color = "black"))
title = list(text = title_fig4,
x = 0,
xanchor = "left",
xref = "paper",
font = list(color = "black", family = "Arial"))
)
# remove legend background
Expand Down
15 changes: 14 additions & 1 deletion tl3-est.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,22 @@ text_all <- dp2 %>%

```{r est_fig4_2}
# put fig4 title in black
title_fig4 <- if (any(ctry %in% c("USA", "TUR", "NOR", "CHE", "IRL"))) {
"Figure 4: Share of workers in most productive (tradable) sectors, \nTL2 regions"
} else {
"Figure 4: Share of workers in most productive (tradable) sectors, \nTL3 regions"
}
# https://stackoverflow.com/questions/34610165/what-is-the-default-font-for-ggplot2
# https://plotly.com/r/reference/layout/
fig4 <- fig4 %>%
layout(
title = list(text = "Figure 4: Share of workers in most productive (tradable) sectors, TL2 regions", x = 0, font = list(color = "black"))
title = list(text = title_fig4,
x = 0,
xanchor = "left",
xref = "paper",
font = list(color = "black", family = "Arial"))
)
# remove legend background
Expand Down
15 changes: 14 additions & 1 deletion tl3-fin.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,22 @@ text_all <- dp2 %>%

```{r fin_fig4_2}
# put fig4 title in black
title_fig4 <- if (any(ctry %in% c("USA", "TUR", "NOR", "CHE", "IRL"))) {
"Figure 4: Share of workers in most productive (tradable) sectors, \nTL2 regions"
} else {
"Figure 4: Share of workers in most productive (tradable) sectors, \nTL3 regions"
}
# https://stackoverflow.com/questions/34610165/what-is-the-default-font-for-ggplot2
# https://plotly.com/r/reference/layout/
fig4 <- fig4 %>%
layout(
title = list(text = "Figure 4: Share of workers in most productive (tradable) sectors, TL2 regions", x = 0, font = list(color = "black"))
title = list(text = title_fig4,
x = 0,
xanchor = "left",
xref = "paper",
font = list(color = "black", family = "Arial"))
)
# remove legend background
Expand Down
Loading

0 comments on commit 6eb90d7

Please sign in to comment.