data-raw/scotland_dental.R

library(tidyverse)

# Child dental health data
# http://statistics.gov.scot/data/child-dental-health
dental <- tribble(~year, ~code, ~percent,
  2006L, "S08000015", 50.9,
  2008L, "S08000015", 63.1,
  2010L, "S08000015", 62.7,
  2012L, "S08000015", 65.5,
  2003L, "S08000015", 46.7,
  2014L, "S08000015", 66.3,
  2004L, "S08000015", 52.0,
  2003L, "S08000016", 62.6,
  2004L, "S08000016", 63.6,
  2006L, "S08000016", 59.8,
  2008L, "S08000016", 70.8,
  2010L, "S08000016", 77.2,
  2012L, "S08000016", 69.2,
  2014L, "S08000016", 76.8,
  2003L, "S08000017", 50.9,
  2004L, "S08000017", 52.5,
  2006L, "S08000017", 57.9,
  2008L, "S08000017", 56.7,
  2010L, "S08000017", 65.8,
  2012L, "S08000017", 62.3,
  2014L, "S08000017", 66.2,
  2004L, "S08000018", 57.3,
  2006L, "S08000018", 57.6,
  2008L, "S08000018", 56.3,
  2010L, "S08000018", 59.7,
  2012L, "S08000018", 68.2,
  2014L, "S08000018", 70.8,
  2003L, "S08000018", 54.3,
  2004L, "S08000019", 55.9,
  2006L, "S08000019", 68.1,
  2008L, "S08000019", 62.6,
  2010L, "S08000019", 73.2,
  2012L, "S08000019", 66.1,
  2014L, "S08000019", 66.2,
  2003L, "S08000019", 45.5,
  2004L, "S08000020", 56.9,
  2006L, "S08000020", 55.5,
  2008L, "S08000020", 58.6,
  2010L, "S08000020", 68.5,
  2012L, "S08000020", 67.9,
  2014L, "S08000020", 73.2,
  2003L, "S08000020", 48.9,
  2003L, "S08000021", 35.2,
  2004L, "S08000021", 42.0,
  2006L, "S08000021", 47.4,
  2008L, "S08000021", 54.8,
  2010L, "S08000021", 58.2,
  2012L, "S08000021", 63.2,
  2014L, "S08000021", 65.3,
  2006L, "S08000022", 56.0,
  2008L, "S08000022", 60.3,
  2010L, "S08000022", 63.7,
  2012L, "S08000022", 70.2,
  2014L, "S08000022", 70.1,
  2003L, "S08000022", 47.7,
  2004L, "S08000022", 52.5,
  2006L, "S08000023", 50.2,
  2008L, "S08000023", 52.2,
  2010L, "S08000023", 60.8,
  2012L, "S08000023", 64.6,
  2014L, "S08000023", 67.8,
  2003L, "S08000023", 40.7,
  2004L, "S08000023", 47.4,
  2003L, "S08000024", 46.3,
  2004L, "S08000024", 49.8,
  2006L, "S08000024", 55.2,
  2008L, "S08000024", 57.1,
  2010L, "S08000024", 68.6,
  2012L, "S08000024", 70.1,
  2014L, "S08000024", 68.9,
  2003L, "S08000025", 45.7,
  2004L, "S08000025", 50.3,
  2006L, "S08000025", 57.0,
  2008L, "S08000025", 66.7,
  2010L, "S08000025", 65.0,
  2012L, "S08000025", 78.7,
  2014L, "S08000025", 72.0,
  2004L, "S08000026", 60.8,
  2006L, "S08000026", 59.7,
  2008L, "S08000026", 62.7,
  2010L, "S08000026", 71.9,
  2012L, "S08000026", 74.7,
  2014L, "S08000026", 80.9,
  2003L, "S08000026", 51.6,
  2004L, "S08000027", 56.7,
  2006L, "S08000027", 57.1,
  2008L, "S08000027", 60.8,
  2010L, "S08000027", 64.8,
  2012L, "S08000027", 63.2,
  2014L, "S08000027", 68.3,
  2003L, "S08000027", 55.3,
  2004L, "S08000028", 41.8,
  2006L, "S08000028", 53.9,
  2008L, "S08000028", 57.7,
  2010L, "S08000028", 56.3,
  2012L, "S08000028", 62.0,
  2014L, "S08000028", 71.7,
  2003L, "S08000028", 35.6)

nhs_scot_dental <- inner_join(dental, nhs_scot_grid, by = c("code" = "code"))

devtools::use_data(nhs_scot_dental, overwrite = TRUE)

ggplot(nhs_scot_dental, aes(x = year, y = percent)) +
  geom_line() +
  facet_geo(~ name, grid = "nhs_scot_grid") +
  scale_x_continuous(breaks = c(2004, 2007, 2010, 2013)) +
  scale_y_continuous(breaks = c(40, 60, 80)) +
  labs(title = "Child Dental Health in Scotland",
    subtitle = "Percentage of P1 children in Scotland with no obvious decay experience.",
    caption = "Source: statistics.gov.scot", x = "", y = "")
hafen/geofacet documentation built on Aug. 26, 2024, 4:41 a.m.