pacman::p_load(eurostat,
countrycode,
leaflet,
sf,
scales,
cowplot,
ggthemes,
tidyverse)Caries Europe Map
Cite this document and map as
Maldupa, I., Sopule, A., Uribe, S.E., Brinkmane, A., and Senakola, E. (2021). Caries Prevalence and Severity for 12-Year-Old Children in Latvia. Int. Dent. J. 71, 214–223.
Packages
Caries data
df <- data.frame(
Country = c("France", "Croatia", "Albania", "Macedonia", "Latvia", "Romania",
"Montenegro", "Bulgaria", "Poland", "Estonia", "Moldova", "Russian Federation",
"Czech Republic", "Belarus", "Lithuania", "Georgia", "Slovenia", "Greece", "Cyprus",
"Portugal", "Italy", "Switzerland", "Belgium", "Spain", "United Kingdom",
"Sweden", "Finland", "Netherlands", "Germany", "Denmark"),
Year = c(2006, 2015, 2011, 2013, 2021, 2011, 2006, 2010, 2014, 2003, 2012, 2008,
2010, 2009, 2008, 2012, 2013, 2011, 2010, 2014, 2012, 2011, 2010, 2019,
2013, 2011, 2009, 2006, 2016, 2014),
DMFT = c(1.2, 4.2, 3.7, 3.5, 3.4, 3.4, 3.4, 3.0, 2.8, 2.8, 2.7, 2.5, 2.1, 2.1, 2.1,
2.0, 1.9, 1.5, 1.3, 1.2, 1.2, 0.9, 0.9, 0.8, 0.8, 0.8, 0.7, 0.6, 0.4, 0.4)
)SHP_0 <- get_eurostat_geospatial(resolution = 10,
nuts_level = 0,
year = 2016)Object cached at /tmp/RtmpDwaAu8/eurostat/sf10020164326.RData
Reading cache file /tmp/RtmpDwaAu8/eurostat/sf10020164326.RData
sf at resolution 1: 10 from year 2016 read from cache file: /tmp/RtmpDwaAu8/eurostat/sf10020164326.RData
Warning in get_eurostat_geospatial(resolution = 10, nuts_level = 0, year =
2016): Default of 'make_valid' for 'output_class="sf"' will be changed in the
future (see function details).
SHP_0 %>%
ggplot() +
geom_sf() +
scale_x_continuous(limits = c(-10, 35)) +
scale_y_continuous(limits = c(35, 65)) +
theme_void()Countrycodes
df$CountryCode <- countrycode(sourcevar = df$Country, origin = "country.name", destination = "iso2c")Join the datasets
caries_data <- df %>%
select(CountryCode, DMFT) %>%
inner_join(SHP_0, by = c("CountryCode" = "geo")) %>%
st_as_sf()Create the map
caries_data %>%
ggplot(aes(fill = DMFT)) +
geom_sf(size = 0.2, color = "#F3F3F3") + # border line
scale_fill_continuous(
type = "viridis",
direction = -1,
name = "DMFT", # title of the legend
breaks = seq(from = 0, to = 5, by = 1),
guide = guide_colorbar(
direction = "vertical", # vertical colorbar
title.position = "top", # title displayed at the top
label.position = "right", # labels displayed at the right side
barwidth = unit(0.4, "cm"), # width of the colorbar
barheight = unit(3, "cm"), # height of the colorbar
ticks = TRUE, # ticks are displayed
)
) +
scale_x_continuous(limits = c(-10, 35)) +
scale_y_continuous(limits = c(35, 65)) +
theme_void() +
theme(
legend.position = c(0.97, 0.50), # relative horizontal, vertical position
plot.caption = element_text(color = "darkgrey", size = 9) # change color and size of caption text
) +
labs(title = "Caries Severity Among 12-Year-Olds in Europe",
subtitle = "Maldupa et al. (2021). Int. Dent. J. 71, 214–223.",
caption = " Data\nAlbania, 2011; Belarus, 2009; Belgium, 2010; Croatia, 2015; Cyprus, 2011;
Czech Republic, 2010; Denmark, 2016; Estonia, 2003; Finland, 2011; France, 2006;
Georgia, 2012; Germany, 2016; Greece, 2011; Italy, 2014; Latvia, 2021; Lithuania, 2008;
Macedonia, 2013; Moldova, 2012; Montenegro, 2006; Netherlands, 2006; Poland, 2014;
Portugal, 2010; Romania, 2011; Slovenia, 2013; Spain, 2019;
Sweden, 2013; Switzerland, 2011; United Kingdom, 2009") Code for the maps modified from http://stavrakoudis.econ.uoi.gr/r-eurostat/drawing-maps-of-europe.html