Gross value added at basic prices by NUTS 3 regions - nama_10r_3gva

Data - Eurostat

Info

LAST_DOWNLOAD

Code
tibble(LAST_DOWNLOAD = as.Date(file.info("~/Library/Mobile\ Documents/com~apple~CloudDocs/website/data/eurostat/nama_10r_3gva.RData")$mtime)) %>%
  print_table_conditional()
LAST_DOWNLOAD
2024-10-08

LAST_COMPILE

LAST_COMPILE
2024-11-23

Last

Code
nama_10r_3gva %>%
  group_by(time) %>%
  summarise(Nobs = n()) %>%
  arrange(desc(time)) %>%
  head(1) %>%
  print_table_conditional()
time Nobs
2022 11851

currency

Code
nama_10r_3gva %>%
  left_join(currency, by = "currency") %>%
  group_by(currency, Currency) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) print_table(.) else .}
currency Currency Nobs
MIO_NAC Million units of national currency 493770
MIO_EUR Million euro 493769

nace_r2

Code
nama_10r_3gva %>%
  left_join(nace_r2, by = "nace_r2") %>%
  group_by(nace_r2, Nace_r2) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

geo

Code
nama_10r_3gva %>%
  left_join(geo, by = "geo") %>%
  group_by(geo, Geo) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

time

Code
nama_10r_3gva %>%
  group_by(time) %>%
  summarise(Nobs = n()) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

nace_r2 - France NUTS 3

Alsace, Champagne-Ardenne, Ile de France, Lorraine

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         geo %in% c("FR10", "FRF1", "FRF2", "FRF3"),
         currency == "MIO_EUR") %>%
  left_join(geo, by = "geo") %>%
  left_join(nace_r2, by = "nace_r2") %>%
  select(Geo, nace_r2, Nace_r2, values) %>%
  group_by(Geo) %>%
  mutate(values = round(100*values / values[nace_r2 == "TOTAL"], 1)) %>%
  spread(Geo, values) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Alsace, Champagne-Ardenne, Ile de France, Lorraine

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         geo %in% c("FRB0", "FRC1", "FRC2", "FRD1"),
         currency == "MIO_EUR") %>%
  left_join(geo, by = "geo") %>%
  left_join(nace_r2, by = "nace_r2") %>%
  select(Geo, nace_r2, Nace_r2, values) %>%
  group_by(Geo) %>%
  mutate(values = round(100*values / values[nace_r2 == "TOTAL"], 1)) %>%
  spread(Geo, values) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Value Added

NUTS 2 Value added by employment (in Total Industry)

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 4,
         currency == "MIO_EUR",
         nace_r2 == "TOTAL") %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value_added = values) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

NUTS 3 Value added by employment (in Total Industry)

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 5,
         currency == "MIO_EUR",
         nace_r2 == "TOTAL") %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value_added = values) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

NUTS 1 Value added by employment (in Total Industry)

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 3,
         currency == "MIO_EUR",
         nace_r2 == "TOTAL") %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value_added = values) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Value Added Per Person

NUTS 2 Value added per person (in Total Industry)

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 4,
         currency == "MIO_EUR",
         nace_r2 == "TOTAL") %>%
  select(geo, value_added = values) %>%
  full_join(nama_10r_3empers %>%
              filter(time == "2015",
                     nchar(geo) == 4,
                     wstatus == "EMP",
                     nace_r2 == "TOTAL") %>%
              select(geo, employment = values), by = "geo") %>%
  mutate(emp_person = round(1000*value_added / employment)) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, emp_person) %>%
  na.omit %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

NUTS 3 Value added per person (in Total Industry)

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 5,
         currency == "MIO_EUR",
         nace_r2 == "TOTAL") %>%
  select(geo, value_added = values) %>%
  full_join(nama_10r_3empers %>%
              filter(time == "2015",
                     nchar(geo) == 5,
                     wstatus == "EMP",
                     nace_r2 == "TOTAL") %>%
              select(geo, employment = values), by = "geo") %>%
  mutate(emp_person = round(1000*value_added / employment)) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, emp_person) %>%
  na.omit %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

NUTS 1 Value added per person (in Total Industry)

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 3,
         currency == "MIO_EUR",
         nace_r2 == "TOTAL") %>%
  select(geo, value_added = values) %>%
  full_join(nama_10r_3empers %>%
              filter(time == "2015",
                     nchar(geo) == 3,
                     wstatus == "EMP",
                     nace_r2 == "TOTAL") %>%
              select(geo, employment = values), by = "geo") %>%
  mutate(emp_person = round(1000*value_added / employment)) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, emp_person) %>%
  arrange(-emp_person) %>%
  na.omit %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Productivity Europe

Total Europe

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 4,
         currency == "MIO_EUR",
         nace_r2 == "TOTAL") %>%
  select(geo, value_added = values) %>%
  full_join(nama_10r_3empers %>%
              filter(time == "2015",
                     nchar(geo) == 4,
                     wstatus == "EMP",
                     nace_r2 == "TOTAL") %>%
              select(geo, employment = values), 
            by = "geo") %>%
  mutate(value = round(1000*value_added / employment)) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value) %>%
  right_join(europe_NUTS2, by = "geo") %>%
  filter(long >= -30, lat >= 25) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value/1000)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = scales::dollar_format(accuracy = 1, prefix = "", suffix = " k€"),
                       breaks = c(seq(0, 80, 10), 100, 200),
                       values = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 1)) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Income")

Manufacturing / Employment

NUTS2

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 4,
         currency == "MIO_EUR",
         nace_r2 == "C") %>%
  select(geo, value_added = values) %>%
  full_join(nama_10r_3empers %>%
              filter(time == "2015",
                     nchar(geo) == 4,
                     wstatus == "EMP",
                     nace_r2 == "TOTAL") %>%
              select(geo, employment = values), 
            by = "geo") %>%
  mutate(value = round(1000*value_added / employment)) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value) %>%
  right_join(europe_NUTS2, by = "geo") %>%
  filter(long >= -15, lat >= 33, value <= 80000) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value/1000)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = scales::dollar_format(accuracy = 1, prefix = "", suffix = " k€"),
                       breaks = c(seq(0, 80, 5), 100, 200),
                       values = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 1),
                       direction = -1) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Manuf / Person")

NUTS3

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 5,
         currency == "MIO_EUR",
         nace_r2 == "C") %>%
  select(geo, value_added = values) %>%
  full_join(nama_10r_3empers %>%
              filter(time == "2015",
                     nchar(geo) == 5,
                     wstatus == "EMP",
                     nace_r2 == "TOTAL") %>%
              select(geo, employment = values), 
            by = "geo") %>%
  mutate(value = round(1000*value_added / employment)) %>%
  filter(!is.na(value)) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value) %>%
  right_join(europe_NUTS3, by = "geo") %>%
  filter(long >= -15, lat >= 33, value <= 80000) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value/1000)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = scales::dollar_format(accuracy = 1, prefix = "", suffix = " k€"),
                       breaks = c(seq(0, 80, 5), 100, 200),
                       values = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 1),
                       direction = -1) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Manuf / Person")

NUTS1

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 3,
         currency == "MIO_EUR",
         nace_r2 == "C") %>%
  select(geo, value_added = values) %>%
  full_join(nama_10r_3empers %>%
              filter(time == "2015",
                     nchar(geo) == 3,
                     wstatus == "EMP",
                     nace_r2 == "TOTAL") %>%
              select(geo, employment = values), 
            by = "geo") %>%
  mutate(value = round(1000*value_added / employment)) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value) %>%
  right_join(europe_NUTS1, by = "geo") %>%
  filter(long >= -15, lat >= 33, value <= 80000) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value/1000)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = scales::dollar_format(accuracy = 1, prefix = "", suffix = " k€"),
                       breaks = c(seq(0, 80, 5), 100, 200),
                       values = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 1),
                       direction = -1) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Manuf / Person")

NUTS0

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 2,
         currency == "MIO_EUR",
         nace_r2 == "C") %>%
  select(geo, value_added = values) %>%
  full_join(nama_10r_3empers %>%
              filter(time == "2015",
                     nchar(geo) == 2,
                     wstatus == "EMP",
                     nace_r2 == "TOTAL") %>%
              select(geo, employment = values), 
            by = "geo") %>%
  mutate(value = round(1000*value_added / employment)) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value) %>%
  right_join(europe_NUTS0, by = "geo") %>%
  filter(long >= -15, lat >= 33, value <= 80000) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value/1000)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = scales::dollar_format(accuracy = 1, prefix = "", suffix = " k€"),
                       breaks = c(seq(0, 80, 5), 100, 200),
                       values = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 1),
                       direction = -1) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Manuf / Person")

Agriculture Value Added / Person

NUTS2

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 4,
         currency == "MIO_EUR",
         nace_r2 == "A") %>%
  select(geo, value_added = values) %>%
  full_join(nama_10r_3empers %>%
              filter(time == "2015",
                     nchar(geo) == 4,
                     wstatus == "EMP",
                     nace_r2 == "TOTAL") %>%
              select(geo, employment = values), 
            by = "geo") %>%
  mutate(value = round(1000*value_added / employment)) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value) %>%
  right_join(europe_NUTS2, by = "geo") %>%
  filter(long >= -15, lat >= 33, value <= 80000) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value/1000)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = scales::dollar_format(accuracy = 1, prefix = "", suffix = " k€"),
                       breaks = c(seq(0, 80, 1), 100, 200),
                       values = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 1),
                       direction = -1) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Agr. Value Added / Person")

NUTS3

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 5,
         currency == "MIO_EUR",
         nace_r2 == "A") %>%
  select(geo, value_added = values) %>%
  full_join(nama_10r_3empers %>%
              filter(time == "2015",
                     nchar(geo) == 5,
                     wstatus == "EMP",
                     nace_r2 == "TOTAL") %>%
              select(geo, employment = values), 
            by = "geo") %>%
  mutate(value = round(1000*value_added / employment)) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value) %>%
  right_join(europe_NUTS3, by = "geo") %>%
  filter(long >= -15, lat >= 33, value <= 80000) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value/1000)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = scales::dollar_format(accuracy = 1, prefix = "", suffix = " k€"),
                       breaks = c(seq(0, 80, 1), 100, 200),
                       values = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 1)) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Agr. Value Added / Person")

NUTS1

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 3,
         currency == "MIO_EUR",
         nace_r2 == "A") %>%
  select(geo, value_added = values) %>%
  full_join(nama_10r_3empers %>%
              filter(time == "2015",
                     nchar(geo) == 3,
                     wstatus == "EMP",
                     nace_r2 == "TOTAL") %>%
              select(geo, employment = values), 
            by = "geo") %>%
  mutate(value = round(1000*value_added / employment)) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value) %>%
  right_join(europe_NUTS1, by = "geo") %>%
  filter(long >= -15, lat >= 33, value <= 80000) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value/1000)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = scales::dollar_format(accuracy = 1, prefix = "", suffix = " k€"),
                       breaks = c(seq(0, 80, 1), 100, 200),
                       values = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 1)) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Agr. Value Added / Person")

NUTS0

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 2,
         currency == "MIO_EUR",
         nace_r2 == "A") %>%
  select(geo, value_added = values) %>%
  full_join(nama_10r_3empers %>%
              filter(time == "2015",
                     nchar(geo) == 2,
                     wstatus == "EMP",
                     nace_r2 == "TOTAL") %>%
              select(geo, employment = values), 
            by = "geo") %>%
  mutate(value = round(1000*value_added / employment)) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value) %>%
  right_join(europe_NUTS0, by = "geo") %>%
  filter(long >= -15, lat >= 33, value <= 80000) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value/1000)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = scales::dollar_format(accuracy = 1, prefix = "", suffix = " k€"),
                       breaks = c(seq(0, 80, 1), 100, 200),
                       values = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 1)) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Manuf / Person")

Animation

Agriculture

Code
options(gganimate.nframes = 50, gganimate.end_pause = 10)
nama_10r_3gva %>%
  filter(nchar(geo) == 4,
         currency == "MIO_EUR",
         nace_r2 == "A") %>%
  select(time, geo, value_added = values) %>%
  full_join(nama_10r_3empers %>%
              filter(nchar(geo) == 4,
                     wstatus == "EMP",
                     nace_r2 == "TOTAL") %>%
              select(time, geo, employment = values), 
            by = c("geo", "time")) %>%
  mutate(value = round(1000*value_added / employment),
         year = as.integer(time)) %>%
  left_join(geo, by = "geo") %>%
  select(year, geo, Geo, value) %>%
  right_join(europe_NUTS2, by = "geo") %>%
  filter(long >= -15, lat >= 33, value <= 80000) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value/1000)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = scales::dollar_format(accuracy = 1, prefix = "", suffix = " k€"),
                       breaks = c(seq(0, 80, 1), 100, 200),
                       values = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 1)) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Agr. Value Added / Person") + 
  transition_time(year) +
  labs(title = "Year: {frame_time}")

Industry

Code
nama_10r_3gva %>%
  filter(nchar(geo) == 5,
         currency == "MIO_EUR",
         nace_r2 == "C") %>%
  select(time, geo, value_added_manuf = values) %>%
  full_join(nama_10r_3gva %>%
              filter(nchar(geo) == 5,
                     currency == "MIO_EUR",
                     nace_r2 == "TOTAL") %>%
              select(time, geo, value_added_total = values), 
            by = c("geo", "time")) %>%
  mutate(value = value_added_manuf / value_added_total,
         year = as.integer(time)) %>%
  left_join(geo, by = "geo") %>%
  select(year, geo, Geo, value) %>%
  left_join(europe_NUTS3, by = "geo") %>%
  filter(long >= -15, lat >= 33) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = percent_format(accuracy = 1),
                       breaks = 0.01*seq(0, 90, 10),
                       values = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 1)) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Manuf Share") + 
  transition_time(year) +
  labs(title = "Year: {frame_time}")

Manufacturing

Code
options(gganimate.nframes = 50, gganimate.end_pause = 10)
nama_10r_3gva %>%
  filter(nchar(geo) == 4,
         currency == "MIO_EUR",
         nace_r2 == "A") %>%
  select(time, geo, value_added_manuf = values) %>%
  full_join(nama_10r_3gva %>%
              filter(nchar(geo) == 4,
                     currency == "MIO_EUR",
                     nace_r2 == "TOTAL") %>%
              select(time, geo, value_added_total = values), 
            by = c("geo", "time")) %>%
  mutate(value = value_added_manuf / value_added_total,
         year = as.integer(time)) %>%
  left_join(geo, by = "geo") %>%
  select(year, geo, Geo, value) %>%
  right_join(europe_NUTS2, by = "geo") %>%
  filter(long >= -15, lat >= 33, value <= 80000) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value/1000)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = percent_format(accuracy = 1),
                       breaks = 0.01*seq(0, 90, 10),
                       values = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 1)) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Manuf Share") + 
  transition_time(year) +
  labs(title = "Year: {frame_time}")

Manufacturing Share

NUTS2

2015

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 4,
         currency == "MIO_EUR",
         nace_r2 == "C") %>%
  select(geo, value_added_manuf = values) %>%
  full_join(nama_10r_3gva %>%
              filter(time == "2015",
                     nchar(geo) == 4,
                     currency == "MIO_EUR",
                     nace_r2 == "TOTAL") %>%
              select(geo, value_added_total = values), 
            by = "geo") %>%
  mutate(value = value_added_manuf / value_added_total) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value) %>%
  right_join(europe_NUTS2, by = "geo") %>%
  filter(long >= -15, lat >= 33) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = percent_format(accuracy = 1),
                       breaks = 0.01*seq(0, 90, 10),
                       values = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 1)) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Manuf Share")

2000

Code
nama_10r_3gva %>%
  filter(time == "2000", 
         nchar(geo) == 4,
         currency == "MIO_EUR",
         nace_r2 == "C") %>%
  select(geo, value_added_manuf = values) %>%
  full_join(nama_10r_3gva %>%
              filter(time == "2000",
                     nchar(geo) == 4,
                     currency == "MIO_EUR",
                     nace_r2 == "TOTAL") %>%
              select(geo, value_added_total = values), 
            by = "geo") %>%
  mutate(value = value_added_manuf / value_added_total) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value) %>%
  right_join(europe_NUTS2, by = "geo") %>%
  filter(long >= -15, lat >= 33) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = percent_format(accuracy = 1),
                       breaks = 0.01*seq(0, 90, 10),
                       values = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 1)) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Manuf Share")

NUTS3

Normal

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 5,
         currency == "MIO_EUR",
         nace_r2 == "C") %>%
  select(geo, value_added_manuf = values) %>%
  full_join(nama_10r_3gva %>%
              filter(time == "2015",
                     nchar(geo) == 5,
                     currency == "MIO_EUR",
                     nace_r2 == "TOTAL") %>%
              select(geo, value_added_total = values), 
            by = "geo") %>%
  mutate(value = value_added_manuf / value_added_total) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value) %>%
  right_join(europe_NUTS3, by = "geo") %>%
  filter(long >= -15, lat >= 33) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = percent_format(accuracy = 1),
                       breaks = 0.01*seq(0, 90, 10),
                       values = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 1)) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Manuf Share")

Inverted

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 5,
         currency == "MIO_EUR",
         nace_r2 == "C") %>%
  select(geo, value_added_manuf = values) %>%
  full_join(nama_10r_3gva %>%
              filter(time == "2015",
                     nchar(geo) == 5,
                     currency == "MIO_EUR",
                     nace_r2 == "TOTAL") %>%
              select(geo, value_added_total = values), 
            by = "geo") %>%
  mutate(value = value_added_manuf / value_added_total) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value) %>%
  right_join(europe_NUTS3, by = "geo") %>%
  filter(long >= -15, lat >= 33) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = percent_format(accuracy = 1),
                       breaks = 0.01*seq(0, 90, 10),
                       values = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 1),
                       direction = -1) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Manuf Share")

NUTS1

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 3,
         currency == "MIO_EUR",
         nace_r2 == "C") %>%
  select(geo, value_added_manuf = values) %>%
  full_join(nama_10r_3gva %>%
              filter(time == "2015",
                     nchar(geo) == 3,
                     currency == "MIO_EUR",
                     nace_r2 == "TOTAL") %>%
              select(geo, value_added_total = values), 
            by = "geo") %>%
  mutate(value = value_added_manuf / value_added_total) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value) %>%
  right_join(europe_NUTS1, by = "geo") %>%
  filter(long >= -15, lat >= 33) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = percent_format(accuracy = 1),
                       breaks = 0.01*seq(0, 90, 10),
                       values = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 1)) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Manuf Share")

NUTS0

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 2,
         currency == "MIO_EUR",
         nace_r2 == "C") %>%
  select(geo, value_added_manuf = values) %>%
  full_join(nama_10r_3gva %>%
              filter(time == "2015",
                     nchar(geo) == 2,
                     currency == "MIO_EUR",
                     nace_r2 == "TOTAL") %>%
              select(geo, value_added_total = values), 
            by = "geo") %>%
  mutate(value = value_added_manuf / value_added_total) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value) %>%
  right_join(europe_NUTS0, by = "geo") %>%
  filter(long >= -15, lat >= 33) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = percent_format(accuracy = 1),
                       breaks = 0.01*seq(0, 90, 10),
                       values = c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 1)) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Manuf Share")

Agriculture Share

NUTS2

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 4,
         currency == "MIO_EUR",
         nace_r2 == "A") %>%
  select(geo, value_added_agriculture = values) %>%
  full_join(nama_10r_3gva %>%
              filter(time == "2015",
                     nchar(geo) == 4,
                     currency == "MIO_EUR",
                     nace_r2 == "TOTAL") %>%
              select(geo, value_added_total = values), 
            by = "geo") %>%
  mutate(value = value_added_agriculture / value_added_total) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value) %>%
  right_join(europe_NUTS2, by = "geo") %>%
  filter(long >= -15, lat >= 33) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = percent_format(accuracy = 1),
                       breaks = 0.01*seq(0, 90, 10),
                       values = c(0, 0.05, 0.10, 0.15, 0.20, 0.25, 1)) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Manuf Share")

NUTS3

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 5,
         currency == "MIO_EUR",
         nace_r2 == "A") %>%
  select(geo, value_added_agriculture = values) %>%
  full_join(nama_10r_3gva %>%
              filter(time == "2015",
                     nchar(geo) == 5,
                     currency == "MIO_EUR",
                     nace_r2 == "TOTAL") %>%
              select(geo, value_added_total = values), 
            by = "geo") %>%
  mutate(value = value_added_agriculture / value_added_total) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value) %>%
  right_join(europe_NUTS3, by = "geo") %>%
  filter(long >= -15, lat >= 33) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = percent_format(accuracy = 1),
                       breaks = 0.01*seq(0, 90, 10),
                       values = c(0, 0.05, 0.10, 0.15, 0.20, 0.25, 1)) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Agriculture Share")

NUTS1

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 3,
         currency == "MIO_EUR",
         nace_r2 == "A") %>%
  select(geo, value_added_agriculture = values) %>%
  full_join(nama_10r_3gva %>%
              filter(time == "2015",
                     nchar(geo) == 3,
                     currency == "MIO_EUR",
                     nace_r2 == "TOTAL") %>%
              select(geo, value_added_total = values), 
            by = "geo") %>%
  mutate(value = value_added_agriculture / value_added_total) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value) %>%
  right_join(europe_NUTS1, by = "geo") %>%
  filter(long >= -15, lat >= 33) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = percent_format(accuracy = 1),
                       breaks = 0.01*seq(0, 90, 10),
                       values = c(0, 0.05, 0.10, 0.15, 0.20, 0.25, 1)) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Agriculture Share")

NUTS0

Code
nama_10r_3gva %>%
  filter(time == "2015", 
         nchar(geo) == 2,
         currency == "MIO_EUR",
         nace_r2 == "A") %>%
  select(geo, value_added_agriculture = values) %>%
  full_join(nama_10r_3gva %>%
              filter(time == "2015",
                     nchar(geo) == 2,
                     currency == "MIO_EUR",
                     nace_r2 == "TOTAL") %>%
              select(geo, value_added_total = values), 
            by = "geo") %>%
  mutate(value = value_added_agriculture / value_added_total) %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, value) %>%
  right_join(europe_NUTS0, by = "geo") %>%
  filter(long >= -15, lat >= 33) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = value)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = percent_format(accuracy = 1),
                       breaks = 0.01*seq(0, 90, 10),
                       values = c(0, 0.05, 0.10, 0.15, 0.20, 0.25, 1)) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Agriculture Share")