Introduction

This is the code used to import and clean the provided data files for the Hackathon. Factors are relevelled so that the logistic regression outout agrees with SAS.

Packages

Load packages required…

library(tidyverse)
## ── Attaching packages ────────────────────────────────────────────────────────────────────────── tidyverse 1.2.1 ──
## ✔ ggplot2 3.0.0     ✔ purrr   0.2.5
## ✔ tibble  1.4.2     ✔ dplyr   0.7.6
## ✔ tidyr   0.8.1     ✔ stringr 1.3.1
## ✔ readr   1.1.1     ✔ forcats 0.3.0
## ── Conflicts ───────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
library(magrittr) #Pipe operators
## 
## Attaching package: 'magrittr'
## The following object is masked from 'package:purrr':
## 
##     set_names
## The following object is masked from 'package:tidyr':
## 
##     extract
library(feather)
library(sf)    #maps and shapefile reading
## Linking to GEOS 3.6.1, GDAL 2.1.3, proj.4 4.9.3
theme_set(theme_minimal(base_size = 16))

Data

Load data -

Note that the synthetic data is for the use of the workshop only and is therefore included in the .gitignore file. This means data is on the local computer only and is not pushed to the GitHub repository.

I’ve downloaded some population estimates for each of the provinces which will help with some of the analysis from the Statistics Canada website here.

I’ve also downloaded a shapefile of Canadian provinces from this link as I think it will be nice to map some of the variables.

raw_data <- read_csv(here::here("raw_data/ipdln_synth_final.csv"))
## Parsed with column specification:
## cols(
##   .default = col_integer()
## )
## See spec(...) for full column specifications.
shapefile <- read_sf(here::here("raw_data/wether_gov_shapefile/province.shp"))

Clean data

Glimpse

The first thing I’ll do is get a quick skim of the raw-data file to get an idea of its structure

glimpse(raw_data)
## Observations: 4,346,649
## Variables: 34
## $ ABDERR_synth             <int> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2...
## $ ABIDENT_synth            <int> 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6...
## $ ADIFCLTY_synth           <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
## $ CITSM_synth              <int> 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
## $ COWD_synth               <int> 4, 4, 7, 4, 4, 7, 4, 4, 7, 4, 4, 4, 4...
## $ DISABFL_synth            <int> 1, 1, 4, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1...
## $ DISABIL_synth            <int> 9, 9, 14, 9, 9, 9, 9, 9, 10, 9, 9, 9,...
## $ DVISMIN_synth            <int> 14, 14, 14, 14, 14, 14, 14, 14, 14, 1...
## $ FOL_synth                <int> 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1...
## $ FPTIM_synth              <int> 1, 1, 3, 2, 1, 3, 1, 1, 3, 1, 1, 1, 1...
## $ GENSTPOB_synth           <int> 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3...
## $ HCDD_synth               <int> 9, 8, 1, 2, 5, 1, 3, 9, 1, 6, 2, 2, 8...
## $ IMMDER_synth             <int> 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3...
## $ LOINCA_synth             <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
## $ LOINCB_synth             <int> 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1...
## $ MARST_synth              <int> 2, 2, 2, 4, 2, 2, 4, 2, 2, 4, 2, 4, 2...
## $ NOCSBRD_synth            <int> 4, 4, 11, 6, 4, 11, 7, 5, 11, 1, 1, 7...
## $ OLN_synth                <int> 3, 1, 2, 3, 1, 2, 3, 1, 3, 3, 1, 3, 1...
## $ POBDER_synth             <int> 3, 3, 1, 1, 2, 1, 1, 1, 1, 1, 2, 3, 1...
## $ SEX_synth                <int> 1, 1, 1, 1, 2, 2, 1, 2, 2, 1, 2, 1, 1...
## $ TRMODE_synth             <int> 2, 2, 9, 5, 2, 9, 2, 2, 9, 2, 2, 7, 2...
## $ RPAIR_synth              <int> 3, 1, 1, 2, 1, 1, 3, 2, 1, 1, 1, 1, 1...
## $ PR_synth                 <int> 35, 46, 24, 59, 48, 13, 24, 59, 35, 1...
## $ RUINDFG_synth            <int> 1, 1, 2, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2...
## $ d_licoratio_da_bef_synth <int> 5, 3, 3, 2, 9, 7, 3, 9, 4, 3, 10, 3, ...
## $ S_DEAD_synth             <int> 2, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2...
## $ EFCNT_PP_R_synth         <int> 4, 5, 2, 4, 4, 3, 3, 2, 2, 1, 2, 3, 3...
## $ AGE_IMM_R_group_synth    <int> 8, 6, 15, 15, 15, 15, 15, 15, 15, 15,...
## $ COD1_synth               <int> 5, 5, 2, 5, 5, 5, 5, 5, 2, 5, 5, 5, 5...
## $ COD2_synth               <int> 14, 14, 13, 14, 14, 14, 14, 14, 5, 14...
## $ DPOB11N_synth            <int> 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1...
## $ KID_group_synth          <int> 2, 3, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 1...
## $ YRIM_group_synth         <int> 1, 1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 2, 6...
## $ age_group_synth          <int> 5, 3, 10, 1, 8, 11, 3, 3, 10, 2, 6, 4...

Ok. All these variables are categorical and we need to label the values as per the metadata held in the metadata file folder (see the github repo for files), but change some of the levels so that we get the correct reference classes in glm().

Missing data

Before we factorise everything - we’d like to check if there is any missing data in the data frame

map_df(raw_data, function(x) sum(is.na(x)))
## # A tibble: 1 x 34
##   ABDERR_synth ABIDENT_synth ADIFCLTY_synth CITSM_synth COWD_synth
##          <int>         <int>          <int>       <int>      <int>
## 1            0             0              0           0          0
## # ... with 29 more variables: DISABFL_synth <int>, DISABIL_synth <int>,
## #   DVISMIN_synth <int>, FOL_synth <int>, FPTIM_synth <int>,
## #   GENSTPOB_synth <int>, HCDD_synth <int>, IMMDER_synth <int>,
## #   LOINCA_synth <int>, LOINCB_synth <int>, MARST_synth <int>,
## #   NOCSBRD_synth <int>, OLN_synth <int>, POBDER_synth <int>,
## #   SEX_synth <int>, TRMODE_synth <int>, RPAIR_synth <int>,
## #   PR_synth <int>, RUINDFG_synth <int>, d_licoratio_da_bef_synth <int>,
## #   S_DEAD_synth <int>, EFCNT_PP_R_synth <int>,
## #   AGE_IMM_R_group_synth <int>, COD1_synth <int>, COD2_synth <int>,
## #   DPOB11N_synth <int>, KID_group_synth <int>, YRIM_group_synth <int>,
## #   age_group_synth <int>

Great, there are no missing values.

Clean names and factorise

raw_data %<>% 
  rename(ab_id_dichot = ABDERR_synth) %>% 
  mutate(vab_id_dichot = if_else(ab_id_dichot == 2, 0L, ab_id_dichot)) %>%
  mutate(ab_id_dichot = factor(ab_id_dichot,
                               levels = c(0, 1),
                               labels = c("Non-Aboriginal ID",
                                          "Aboriginal ID"
                                          ))
         ) %>% 
  rename(ab_id_detailed = ABIDENT_synth) %>% 
  mutate(ab_id_detailed = factor(ab_id_detailed,
                                 levels = c(1:6),
                                 labels = c("North_Am_Indian", "Mètis",
                                            "Inuit",
                                            "Multiple Aborginal ID", 
                                            "Other Aboriginal",
                                            "Non-Aboriginal"))
         ) %>% 
  rename(adl_difficulty = ADIFCLTY_synth) %>% 
  mutate(adl_difficulty = factor(adl_difficulty,
                                 levels = c(1:4),
                                 labels = c("No", "Not stated", "Often",
                                            "Sometimes"))
         ) %>% 
  rename(age_imm = AGE_IMM_R_group_synth) %>% 
  mutate(age_imm = factor(age_imm,
                          levels = c(1:15),
                          labels = c("<5", "5 to <10", "10 to <15",
                                     "15 to <20", "20 to <25", "25 to <30",
                                     "30 to <35", "35 to <40", "40 to <45",
                                     "45 to <50", "50 to <55", "55 to <60",
                                     "60 and over", 
                                     "Non-permanent resident",
                                     "Non-imigrant and others"
                                     ))
         ) %>% 
  rename(citizen_stat = CITSM_synth) %>% 
  mutate(citizen_stat = factor(citizen_stat,
                               levels = c(1, 2),
                               labels = c("Canadian", "non-Canadian"))
         ) %>% 
  rename(cause_death_1 = COD1_synth) %>% 
  mutate(cause_death_1 = factor(cause_death_1,
                                levels = c(1:5),
                                labels = c("Communicable etc.", 
                                           "Noncommunicable", "Injuries",
                                           "Other causes or NA",
                                           "Did not Die"))
         ) %>% 
  rename(cause_death_2 = COD2_synth) %>% 
  mutate(cause_death_2 = factor(cause_death_2,
                                levels = c(1:14),
                                labels = c("Infectious diseases", 
                                           "Respiratory infections",
                                           "Colon and rectal cancers",
                                           "Breast cancers", "Diabetes",
                                           "Dementia", "IHD", "CVD",
                                           "Respiratory diseases",
                                           "Digestive diseases",
                                           "Genitourinary diseases",
                                           "Unintentional injuries",
                                           "Other causes or NA",
                                           "Did not Die"
                                           ))
         ) %>% 
  rename(worker_class = COWD_synth) %>% 
  mutate(worker_class = factor(worker_class,
                               levels = c(1:7),
                               labels = c("Unpaid family workers", 
                                          "Paid worker,no help",
                                          "Paid worker,paid help",
                                          "Paid Worker",
                                          "Self-employed,no help",
                                          "Self-employed,paid help",
                                          "Not applicable "))
         ) %>% 
  rename(adl_disab_difficulty = DISABFL_synth) %>% 
  mutate(adl_disab_difficulty = factor(adl_disab_difficulty,
                                       levels = c(1:4),
                                       labels = c("No", "Not stated",
                                                  "Often", "Sometimes"))
         ) %>% 
  rename(adl_disab_diff_type = DISABIL_synth) %>% 
  mutate(adl_disab_diff_type = factor(adl_disab_diff_type,
                                      levels = c(1:17),
                                      labels = c("ADL & Home & other",
                                                 "ADL & Home & Work/School",
                                                 "ADL & Home & Work/School & other",
                                                 "ADL & Work & other", "ADL & Home",
                                                 "ADL & other", "ADL & Work/school",
                                                 "ADL", "None", "Home & other",
                                                 "Home & Work/school",
                                                 "Home & Work/school & other",
                                                 "Work/school & other", "Home",
                                                 "Other", "Work/school",
                                                 "Not stated"))
         ) %>% 
  rename(birth_country = DPOB11N_synth) %>% 
  mutate(birth_country = factor(birth_country,
                                levels = c(1:10),
                                labels = c("non-Immigrant",
                                           "Latin America & Caribbean",
                                           "Western Europe", "Eastern Europe",
                                           "Sub-Saharan Africa",
                                           "N Africa, SW Asia & Middle East",
                                           "S Asia", "SE Asia", "E Asia", 
                                           "Australia, NZ, Oceania & Greenland"))
         ) %>% 
  rename(vis_minority = DVISMIN_synth) %>% 
  mutate(vis_minority = if_else(vis_minority == 14, 0L, vis_minority)) %>%
  mutate(vis_minority = if_else(vis_minority == 13, 0L, vis_minority)) %>%
  mutate(vis_minority = if_else(vis_minority == 12, 11L, vis_minority)) %>%
  mutate(vis_minority = factor(vis_minority,
                               levels = c(0:11),
                               labels = c("Not a visible minority",
                                          "Chinese", "South Asian", "Black",
                                          "Filipino", "Latin American", 
                                          "Southeast Asian", "Arab", "West Asian",
                                          "Korean", "Japanese", 
                                          "Other/multiple visible minority"
                                          ))
         ) %>% 
  rename(no_fam_members = EFCNT_PP_R_synth) %>% 
  mutate(no_fam_members = factor(no_fam_members,
                                 levels = c(1:10),
                                 labels = c("1", "2", "3", "4", "5",
                                            "6", "7", "8", "9", "10 or more"))
         ) %>% 
  rename(first_lang = FOL_synth) %>% 
  mutate(first_lang = factor(first_lang,
                             levels = c(1:4),
                             labels = c("English", "French", "English & French",
                                        "Other"))
         ) %>% 
  rename(employ_status = FPTIM_synth) %>% 
  mutate(employ_status = factor(employ_status,
                                levels = c(1:3),
                                labels = c("Full-time", "Part-time", "Didn't work"))
         ) %>% 
  #Note the definitions in the metadata file - 3rd generation does not mean
  #what I would intuitively think
  rename(generation = GENSTPOB_synth) %>% 
  mutate(generation = if_else(generation == 3, 0L, generation)) %>%
  mutate(generation = factor(generation,
                             levels = c(0:2),
                             labels = c("3rd Generation","1st Generation", "2nd Generation"))
         ) %>%
  rename(education = HCDD_synth) %>% 
  mutate(education = if_else(education == 2, 0L, education)) %>%
  mutate(education = factor(education,
                            levels = c(0,1,3:13),
                            labels = c("High School", "None", "Trades Cert/Dip",
                                       "Apprenticeship Cert/Dip",
                                       "Non-Uni Cert/Dip < 1 year",
                                       "Non-Uni Cert/Dip 1-2 years",
                                       "Non-Uni Cert/Dip > 2years",
                                       "Uni Cert/Dip below Bachelor's",
                                       "Bachelor's degree",
                                       "Uni Cert/Dip above Bachelor's",
                                       "Medicine etc.", "Master's degree",
                                       "Doctorate"))
         ) %>% 
  rename(immigration_stat = IMMDER_synth) %>% 
  mutate(immigration_stat = factor(immigration_stat,
                                   levels = c(1:3),
                                   labels = c("Immigrant", "Non-permanent resident",
                                              "Non-immigrant"))
         ) %>% 
  rename(no_kids = KID_group_synth) %>% 
  mutate(no_kids = factor(no_kids,
                          levels = c(1:3),
                          labels = c("None", "1 or 2",
                                     "3 or more"))
         ) %>% 
  rename(lo_inc_aftertax = LOINCA_synth) %>% 
  mutate(lo_inc_aftertax = factor(lo_inc_aftertax,
                                  levels = c(1:3),
                                  labels = c("non-low income", "low income",
                                             "Concept not applicable"))
         ) %>% 
  rename(lo_inc_beforetax = LOINCB_synth) %>% 
  mutate(lo_inc_beforetax = factor(lo_inc_beforetax,
                                   levels = c(1:3),
                                  labels = c("non-low income", "low income",
                                             "Concept not applicable"))
         ) %>% 
  rename(mar_stat = MARST_synth) %>% 
  mutate(mar_stat = if_else(mar_stat == 2, 0L, mar_stat)) %>%
  mutate(mar_stat = factor(mar_stat,
                           levels = c(0,1,3,4,5),
                           labels = c("Married", "Divorced", "Separated",
                                      "Never married", "Widowed"))
         ) %>%
  rename(occupation = NOCSBRD_synth) %>% 
  mutate(occupation = factor(occupation,
                             levels = c(1:11),
                             labels = c("Management", "Business", 
                                        "Science", "Health", "Govt & Religion",
                                        "Art & Culture", "Sales & Service",
                                        "Trades & Transport", "Primary industry",
                                        "Manufacturing", "Not Applicable"))
         ) %>% 
  rename(official_lang = OLN_synth) %>% 
  mutate(official_lang = factor(official_lang,
                                levels = c(1:4),
                                labels = c("English", "French", "English & French",
                                           "Other"))
         ) %>% 
  rename(place_of_birth = POBDER_synth) %>% 
  mutate(place_of_birth = factor(place_of_birth,
                                 levels = c(1:3),
                                 labels = c("Home province","Other province",
                                            "Outside Canada"))
         ) %>% 
  rename(province = PR_synth) %>% 
  mutate(province = if_else(province == 35, 0L, province)) %>%
  mutate(province = factor(province,
                           levels = c(0, 10, 11, 12, 13, 24,
                                      46, 47, 48, 59, 60, 61, 62),
                           labels = c("Ontario", "Newfoundland and Labrador",
                                      "Prince Edward Island",
                                      "Nova Scotia", "New Brunswick", "Quebec",
                                      "Manitoba", "Saskatchewan",
                                      "Alberta", "British Columbia", "Yukon",
                                      "Northwest Territories", "Nunavut"))
         ) %>%
  rename(repairs = RPAIR_synth) %>% 
  mutate(repairs = factor(repairs,
                          levels = c(1:4),
                          labels = c("No", "Minor", "Major", "Not applicable"))
         ) %>% 
  rename(rur_urb = RUINDFG_synth) %>% 
  mutate(rur_urb = if_else(rur_urb == 2, 0L, rur_urb)) %>%
  mutate(rur_urb = factor(rur_urb,
                          levels = c(0, 1),
                          labels = c("Urban", "Rural"))
        ) %>% 
  rename(sex = SEX_synth) %>% 
  mutate(sex = factor(sex,
                      levels = c(1, 2),
                      labels = c("Female", "Male"))
         ) %>% 
  rename(dead = S_DEAD_synth) %>% 
  mutate(dead = if_else(dead == 2, 0L, dead)) %>%
  mutate(dead = factor(dead,
                       levels = c(0,1),
                       labels = c("Not Dead", "Dead"))
         ) %>% 
  rename(transport = TRMODE_synth) %>% 
  mutate(transport = factor(transport,
                            levels = c(1:9),
                            labels = c("Bicycle", "Driver", "Motorbike",
                                       "Other", "Passenger", "Taxi", 
                                       "Public Transport", "Walk", "Not applicable"))
         ) %>% 
  rename(year_imm = YRIM_group_synth) %>% 
  mutate(year_imm = factor(year_imm,
                           levels = c(1:6),
                           labels = c("2002 or later", "1997-2001", "1987-1996",
                                      "1986 or earlier", "Non-permanent resident",
                                      "Non-immigrant and others"))
         ) %>% 
  rename(age_grp = age_group_synth) %>% 
  mutate(age_grp = factor(age_grp,
                          levels = c(1:15),
                          labels = c("19-24", "25-29", "30-34", "35-39", "40-44",
                                     "45-49", "50-54", "55-59", "60-64", "65-69",
                                     "70-74", "75-79", "80-84", "85-89", "90 plus"))
         ) %>% 
  rename(loinc_decile = d_licoratio_da_bef_synth) %>% 
  mutate(loinc_decile = if_else(loinc_decile == 10, 0L, loinc_decile)) %>%
  mutate(loinc_decile = factor(loinc_decile,
                               levels = c(0:9),
                               labels = c("10 - highest", "1 - lowest", "2", "3", "4", "5",
                                          "6", "7", "8", "9" )))

Save

We’ll save the cleaned dataset with a new name clean_data which can be loaded directly in other analysis files, using the feather package which is much faster than the base R save() and load().

clean_data <- raw_data
write_feather(clean_data, path=here::here("assets/clean_data/clean_data.feather"))
rm(raw_data)

Shapefile

**also try https://www.weather.gov/gis/CanadianProvinces**

Quick look at the shapefile to make sure everything is in order

glimpse(shapefile)

Need to change one variable name and drop some unneeded variables

shapefile %<>% 
  rename(province = NAME) %>% 
  select(province, geometry)

And a quick plot of the blank file to check it looks ok

shapefile %>% 
  ggplot() +
  geom_sf() +
  theme(line = element_blank(),
        axis.text = element_blank(),
        panel.grid = element_line(colour = "transparent"))

Save it

save(shapefile, file = here::here("assets/clean_data/shapefile.rds"))

Session info

devtools::session_info()
## Session info -------------------------------------------------------------
##  setting  value                       
##  version  R version 3.5.1 (2018-07-02)
##  system   x86_64, darwin15.6.0        
##  ui       X11                         
##  language (EN)                        
##  collate  en_AU.UTF-8                 
##  tz       America/Edmonton            
##  date     2018-09-13
## Packages -----------------------------------------------------------------
##  package    * version date       source        
##  assertthat   0.2.0   2017-04-11 CRAN (R 3.5.0)
##  backports    1.1.2   2017-12-13 CRAN (R 3.5.0)
##  base       * 3.5.1   2018-07-05 local         
##  bindr        0.1.1   2018-03-13 CRAN (R 3.5.0)
##  bindrcpp   * 0.2.2   2018-03-29 CRAN (R 3.5.0)
##  broom        0.5.0   2018-07-17 CRAN (R 3.5.0)
##  cellranger   1.1.0   2016-07-27 CRAN (R 3.5.0)
##  class        7.3-14  2015-08-30 CRAN (R 3.5.1)
##  classInt     0.2-3   2018-04-16 CRAN (R 3.5.0)
##  cli          1.0.0   2017-11-05 CRAN (R 3.5.0)
##  colorspace   1.3-2   2016-12-14 CRAN (R 3.5.0)
##  compiler     3.5.1   2018-07-05 local         
##  crayon       1.3.4   2017-09-16 CRAN (R 3.5.0)
##  datasets   * 3.5.1   2018-07-05 local         
##  DBI          1.0.0   2018-05-02 CRAN (R 3.5.0)
##  devtools     1.13.6  2018-06-27 CRAN (R 3.5.0)
##  digest       0.6.16  2018-08-22 CRAN (R 3.5.0)
##  dplyr      * 0.7.6   2018-06-29 CRAN (R 3.5.1)
##  e1071        1.7-0   2018-07-28 CRAN (R 3.5.0)
##  evaluate     0.11    2018-07-17 CRAN (R 3.5.0)
##  fansi        0.3.0   2018-08-13 CRAN (R 3.5.0)
##  feather    * 0.3.1   2016-11-09 CRAN (R 3.5.0)
##  forcats    * 0.3.0   2018-02-19 CRAN (R 3.5.0)
##  ggplot2    * 3.0.0   2018-07-03 CRAN (R 3.5.0)
##  glue         1.3.0   2018-07-17 CRAN (R 3.5.0)
##  graphics   * 3.5.1   2018-07-05 local         
##  grDevices  * 3.5.1   2018-07-05 local         
##  grid         3.5.1   2018-07-05 local         
##  gtable       0.2.0   2016-02-26 CRAN (R 3.5.0)
##  haven        1.1.2   2018-06-27 CRAN (R 3.5.0)
##  here         0.1     2017-05-28 CRAN (R 3.5.0)
##  hms          0.4.2   2018-03-10 CRAN (R 3.5.0)
##  htmltools    0.3.6   2017-04-28 CRAN (R 3.5.0)
##  httr         1.3.1   2017-08-20 CRAN (R 3.5.0)
##  jsonlite     1.5     2017-06-01 CRAN (R 3.5.0)
##  knitr        1.20    2018-02-20 CRAN (R 3.5.0)
##  lattice      0.20-35 2017-03-25 CRAN (R 3.5.1)
##  lazyeval     0.2.1   2017-10-29 CRAN (R 3.5.0)
##  lubridate    1.7.4   2018-04-11 CRAN (R 3.5.0)
##  magrittr   * 1.5     2014-11-22 CRAN (R 3.5.0)
##  memoise      1.1.0   2017-04-21 CRAN (R 3.5.0)
##  methods    * 3.5.1   2018-07-05 local         
##  modelr       0.1.2   2018-05-11 CRAN (R 3.5.0)
##  munsell      0.5.0   2018-06-12 CRAN (R 3.5.0)
##  nlme         3.1-137 2018-04-07 CRAN (R 3.5.1)
##  pillar       1.3.0   2018-07-14 CRAN (R 3.5.0)
##  pkgconfig    2.0.2   2018-08-16 CRAN (R 3.5.0)
##  plyr         1.8.4   2016-06-08 CRAN (R 3.5.0)
##  purrr      * 0.2.5   2018-05-29 CRAN (R 3.5.0)
##  R6           2.2.2   2017-06-17 CRAN (R 3.5.0)
##  Rcpp         0.12.18 2018-07-23 CRAN (R 3.5.0)
##  readr      * 1.1.1   2017-05-16 CRAN (R 3.5.0)
##  readxl       1.1.0   2018-04-20 CRAN (R 3.5.0)
##  rlang        0.2.2   2018-08-16 CRAN (R 3.5.0)
##  rmarkdown    1.10    2018-06-11 CRAN (R 3.5.0)
##  rprojroot    1.3-2   2018-01-03 CRAN (R 3.5.0)
##  rstudioapi   0.7     2017-09-07 CRAN (R 3.5.0)
##  rvest        0.3.2   2016-06-17 CRAN (R 3.5.0)
##  scales       1.0.0   2018-08-09 CRAN (R 3.5.0)
##  sf         * 0.6-3   2018-05-17 CRAN (R 3.5.0)
##  spData       0.2.9.3 2018-08-01 CRAN (R 3.5.0)
##  stats      * 3.5.1   2018-07-05 local         
##  stringi      1.2.4   2018-07-20 CRAN (R 3.5.0)
##  stringr    * 1.3.1   2018-05-10 CRAN (R 3.5.0)
##  tibble     * 1.4.2   2018-01-22 CRAN (R 3.5.0)
##  tidyr      * 0.8.1   2018-05-18 CRAN (R 3.5.0)
##  tidyselect   0.2.4   2018-02-26 CRAN (R 3.5.0)
##  tidyverse  * 1.2.1   2017-11-14 CRAN (R 3.5.0)
##  tools        3.5.1   2018-07-05 local         
##  units        0.6-0   2018-06-09 CRAN (R 3.5.0)
##  utf8         1.1.4   2018-05-24 CRAN (R 3.5.0)
##  utils      * 3.5.1   2018-07-05 local         
##  withr        2.1.2   2018-03-15 CRAN (R 3.5.0)
##  xml2         1.2.0   2018-01-24 CRAN (R 3.5.0)
##  yaml         2.2.0   2018-07-25 CRAN (R 3.5.0)