# lpath <- "/home/ad.abt.local/layc/R/library" # assign library for user w/o admin priveleges on ACE3
# .libPaths(lpath)
library(here) # convenience for filepaths dynamic
## here() starts at C:/Users/LayC/Projects/cira3-mortality
here <- here::here # to avoid overwrite
if(grepl("C://Users/", here())){
lpath = paste("C://Users/", Sys.info( )["login"], "/R.lib", sep = "")
.libPaths(lpath)}
#library(chron)
library(tictoc) # for system time
library(readxl) # for reading in excel
library(readr) # for csv
library(survival) # from original vodonos code. Loaded for compatibility
library(splines) # for splines
library(MASS) # for mvmeta, likely
#library(nlme)
library(mgcv) # from original vodonos code. Loaded for compatibility
## Loading required package: nlme
## This is mgcv 1.8-31. For overview type 'help("mgcv-package")'.
library(dlnm) # from original vodonos code. Loaded for compatibility
## This is dlnm 2.3.9. For details: help(dlnm) and vignette('dlnmOverview').
library(tsModel) # from original vodonos code. Loaded for compatibility
## Time Series Modeling for Air Pollution and Health (0.6)
library(mvmeta) # from original vodonos code. Loaded for compatibility
## This is mvmeta 1.0.3. For an overview type: help('mvmeta-package').
library(data.table) # fread for faster read (read.table takes >15 min)
library(tidyverse)
## -- Attaching packages ------------------------------------------------ tidyverse 1.3.0 --
## v ggplot2 3.2.1 v dplyr 0.8.4
## v tibble 2.1.3 v stringr 1.4.0
## v tidyr 1.0.2 v forcats 0.4.0
## v purrr 0.3.3
## -- Conflicts --------------------------------------------------- tidyverse_conflicts() --
## x dplyr::between() masks data.table::between()
## x dplyr::collapse() masks nlme::collapse()
## x dplyr::filter() masks stats::filter()
## x dplyr::first() masks data.table::first()
## x dplyr::lag() masks stats::lag()
## x dplyr::last() masks data.table::last()
## x dplyr::select() masks MASS::select()
## x purrr::transpose() masks data.table::transpose()
library(scales)
##
## Attaching package: 'scales'
## The following object is masked from 'package:purrr':
##
## discard
## The following object is masked from 'package:readr':
##
## col_factor
select <- dplyr::select # to re-assign select to specify dplyr as is more commonly used than raster and MASS functions in script below.
# Temporary fix due to changes in nest/unnest syntax (deprecated arguments)
nest <- nest_legacy
unnest <- unnest_legacy
#library(RcppRoll) # rolling averages from vodonos? Likey not needed
library(purrr) # for iterative processing.
library(gridExtra) # for grid.arrange
##
## Attaching package: 'gridExtra'
## The following object is masked from 'package:dplyr':
##
## combine
Make plots for fitted dose respone curves for temperature
source(here::here("/code/functions/01_cluster_load_cp.r"))# load cluster functions
rm("cluster_load_cp"); rm("cluster_load_mv") # remove extra functions used for meta analysis
print(cluster_load)
## function (c_cluster = 6, nsim = 1000, out_folder = "output/vodonos_out/2019-06-13_mvcl_4_time",
## time_periods = c(3, 4))
## {
## require(here)
## require(dplyr)
## require(tidyr)
## require(purrr)
## require(MASS)
## print(c_cluster)
## cluster_f <- tibble(cluster = c_cluster, time_period = time_periods,
## cp_fname = here::here(out_folder, gsub("X", c_cluster,
## paste0("mv_clX/mv_clX/cp.clusterX.years", time_period,
## ".Rdata"))), cp_out = map(cp_fname, .f = load_parms),
## mv_fname = here::here(out_folder, gsub("X", c_cluster,
## paste0("mv_clX/mv_clX/mv_clX_y", time_period, ".Rdata"))),
## mv_out = map(mv_fname, .f = load_parms), daily_arg = map(cp_out,
## ~pluck_all(., col = "cp_0", ns = nsim)), ma15_arg = map(cp_out,
## ~pluck_all(., col = "cp_05", ns = nsim)))
## }
source(here::here("code/functions/03_lag_calc.R"))
print(lag_calc)
## function (tmean_2lag = tmean_daily$doy_tmean0[[1]])
## {
## lagged_tmean <- tmean_2lag %>% mutate(tmeanL1 = ifelse(is.na(lag(tmean0)),
## tmean0, lag(tmean0)), tmeanL2 = ifelse(is.na(lag(tmean0,
## 2)), tmean0, lag(tmean0, 2)), tmeanL3 = ifelse(is.na(lag(tmean0,
## 3)), tmean0, lag(tmean0, 3)), tmeanL4 = ifelse(is.na(lag(tmean0,
## 4)), tmean0, lag(tmean0, 4)), tmean15 = (tmean0 + tmeanL1 +
## tmeanL2 + tmeanL3 + tmeanL4)/5) %>% select(-starts_with("tmeanL"))
## return(lagged_tmean)
## }
source(here::here("code/functions/06_rr_calc.R"))
print(calc_rr_se)
## function (tmean = seq(-25, 42, 1), coef_mat = pluck(cl4_y3, "cp_out",
## 1, "cp_0", "coefficients"), vcov_mat = pluck(cl4_y3, "cp_out",
## 1, "cp_0", "vcov"), center_val = 15.6, degree_val = 2, knot_vec = pluck(cl4_y3,
## "cp_out", 1, "knots_1"), bound_vec = c(-25, 42))
## {
## require(dlnm)
## require(splines)
## bs_ce <- bs(center_val, degree = degree_val, knots = knot_vec,
## Bound = bound_vec, intercept = FALSE)
## bs_var <- suppressWarnings(bs(tmean, degree = degree_val,
## knots = knot_vec, Bound = bound_vec, intercept = FALSE))
## bs_vc <- scale(bs_var, center = bs_ce, scale = FALSE)
## rr_log <- as.numeric(bs_vc %*% coef_mat)
## rr_log_se <- sqrt(pmax(0, rowSums((bs_vc %*% vcov_mat) *
## bs_vc)))
## RR_an <- 1 - exp(-rr_log)
## RR_an_low <- 1 - exp(-(rr_log - 1.96 * rr_log_se))
## RR_an_high <- 1 - exp(-(rr_log + 1.96 * rr_log_se))
## tibble(rr_log = rr_log, rr_log_se = rr_log_se, RR = RR_an,
## RR_lci = RR_an_low, RR_uci = RR_an_high)
## }
if(!dir.exists(here("output/y4-final-manuscript-output/plots/2020-02-24-Manu-Fitted-DR-Fig/"))){ dir.create(here("output/y4-final-manuscript-output/plots/2020-02-24-Manu-Fitted-DR-Fig/"), recursive = TRUE)}
cluster_fits <- seq(1,9) %>%
map_dfr(cluster_load,
nsim = 1000,
out_folder = "output/vodonos_out/2019-06-13_mvcl_4_time/",
time_periods = c(1,2,3,4)
)
## [1] 1
## [1] 2
## [1] 3
## [1] 4
## [1] 5
## [1] 6
## [1] 7
## [1] 8
## [1] 9
cluster_fits %>% glimpse()
## Observations: 36
## Variables: 8
## $ cluster <int> 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5...
## $ time_period <dbl> 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3...
## $ cp_fname <chr> "C:/Users/LayC/Projects/cira3-mortality/output/vodonos_...
## $ cp_out <list> [[<-1.690000e+01, -1.680000e+01, -1.670000e+01, -1.660...
## $ mv_fname <chr> "C:/Users/LayC/Projects/cira3-mortality/output/vodonos_...
## $ mv_out <list> [[[<matrix[5 x 5]>, <matrix[5 x 5]>, <matrix[5 x 5]>, ...
## $ daily_arg <list> [[<-16.9, 30.2>, <-1.302139, 11.913495, 23.875105>, <0...
## $ ma15_arg <list> [[<-13.6, 28.2>, <-3.289712, 6.960163, 16.811502, 24.7...
get_rr_cluster_f <- function(cl_obj=cluster_fits, cls=1) {
fitt = cl_obj %>% select(cluster, time_period, cp_out) %>% filter(cluster ==cls)
dframe0 = fitt %>%
mutate(Cluster = cls,
`Lag` = "lag 0",
temp_range = map(cp_out, .f = pluck, "cp_0", "predvar"),
RR =map(cp_out, .f = pluck, "cp_0", "matRRfit" ),
RR_h =map(cp_out, .f = pluck, "cp_0", "matRRhigh" ) ,
RR_l =map(cp_out, .f = pluck, "cp_0", "matRRlow" )
) %>%
select(Cluster, `Lag`, time_period, temp_range, RR, RR_h, RR_l) %>% unnest()
dframe05 = fitt %>%
mutate(Cluster = cls,
`Lag` = "MA15",
temp_range = map(cp_out, .f = pluck, "cp_05", "predvar"),
RR =map(cp_out, .f = pluck, "cp_05", "matRRfit" ),
RR_h =map(cp_out, .f = pluck, "cp_05", "matRRhigh" ) ,
RR_l =map(cp_out, .f = pluck, "cp_05", "matRRlow" )) %>%
select(Cluster,`Lag`, time_period, temp_range, RR, RR_h, RR_l) %>% unnest()
bind_rows(dframe0, dframe05)
}
cluster_plot_frame <- map_dfr(1:9, get_rr_cluster_f, cl_obj = cluster_fits) %>%
mutate(Cluster = factor(Cluster, levels = 1:9, labels = c("1: NE Coast", "2: NE", "3: Midwest", "4: SE Central", "5: W Coast",
"6: N Gulf", "7: SE Reach", "8: SW", "9: West" )),
`Daily mean temperature (C)`=temp_range,
timelab = case_when(
time_period == 1 ~ '1973-1983',
time_period == 2 ~ '1983-1993',
time_period == 3 ~ '1993-2003',
time_period == 4 ~ '2003-2013'
),
`Time period` = factor(timelab) ,
Lag = factor(Lag))
full_plot <- cluster_plot_frame %>%
ggplot(aes(x=`Daily mean temperature (C)`, y = RR, color = `Time period`, linetype = `Lag`)) +
geom_line() +
ylim(.8, 1.4)+
ylab("Relative Risk") +
theme_classic(base_size = 14) +
scale_color_viridis_d(direction=-1, begin = 0, end = 0.8 ) +
facet_wrap(~Cluster)
full_plot %>% print()
ggsave(filename=here("output/y4-final-manuscript-output/plots/2020-02-24-Manu-Fitted-DR-Fig//Facet-Cluster-RR-15.6C.pdf"), plot =full_plot, device = NULL, width = 7, height = 8)
ggsave(filename=here("output/y4-final-manuscript-output/plots/2020-02-24-Manu-Fitted-DR-Fig//Facet-Cluster-RR-15.6C.png"), plot =full_plot, device = NULL,width = 7, height = 8)
y4_RR_plot <- cluster_plot_frame %>% filter(time_period == 4) %>%
ggplot(aes(x=`Daily mean temperature (C)`, y = RR )) +
geom_line( aes( color = Lag) ) +
geom_ribbon(aes(ymin=RR_l, ymax=RR_h, fill = Lag),alpha=0.2) +
ylim(.8, 1.2)+
ylab("Relative Risk") +
scale_color_manual(values= c("#f46d43", "#2c7bb6")) +
theme_classic(base_size = 14) +
facet_wrap(~Cluster)
y4_RR_plot %>% print()
ggsave(filename=here("output/y4-final-manuscript-output/plots/2020-02-24-Manu-Fitted-DR-Fig//Y4fit_Facet-Cluster-RR-15.6C.pdf"), plot =y4_RR_plot, device = NULL, width = 7, height = 8)
ggsave(filename=here("output/y4-final-manuscript-output/plots/2020-02-24-Manu-Fitted-DR-Fig//Y4fit_Facet-Cluster-RR-15.6C.png"), plot =y4_RR_plot, device = NULL,width = 7, height = 8)
The original crosspred output can’t be directly used for RR total projection because it cuts off the out of bounds temperatures. In some places, that makes for very short curves since the MA15 and lag 0 don’t have many matching temps.
First, create the dataframe.
cluster_fits_y4 <- cluster_fits %>% filter(time_period == 4)
cluster_ar_plot_frame_0 <-
map_dfr(
1:9,
~ calc_rr_se (
tmean = seq(-20, 40,0.25),
coef_mat = pluck(cluster_fits_y4, "cp_out",., "cp_0", "coefficients") ,
vcov_mat = pluck(cluster_fits_y4, "cp_out", ., "cp_0", "vcov") ,
center_val = 15.6 ,
# default across all clusters
degree_val = 2,
knot_vec = pluck(cluster_fits_y4, "cp_out", ., "knots_1") ,
bound_vec = pluck(cluster_fits_y4, "daily_arg", ., "bound")
),
.id="Cluster" ) %>%
mutate(temp_range = rep(seq(-20, 40,0.25), 9)) %>%
pivot_longer(rr_log:RR_uci)
cluster_ar_plot_frame_5 <-
map_dfr(
1:9,
~ calc_rr_se (
tmean = seq(-20, 40,0.25),
coef_mat = pluck(cluster_fits_y4, "cp_out",., "cp_05", "coefficients") ,
vcov_mat = pluck(cluster_fits_y4, "cp_out", ., "cp_05", "vcov") ,
center_val = 15.6 ,
# default across all clusters
degree_val = 2,
knot_vec = pluck(cluster_fits_y4, "cp_out", ., "knots_2") ,
bound_vec = pluck(cluster_fits_y4, "ma15_arg", ., "bound")
),
.id="Cluster" )%>%
mutate(temp_range = rep(seq(-20, 40,0.25), 9)) %>%
pivot_longer(rr_log:RR_uci)
# Join lag 0 and ma15 together
cluster_rr_total_plot <- cluster_ar_plot_frame_0 %>%
left_join(cluster_ar_plot_frame_5, by = c("Cluster", "name", "temp_range"), suffix = c(".lag 0", ".MA15")) %>%
mutate(value.total = (`value.lag 0`+value.MA15)/2) %>%
pivot_longer(`value.lag 0`:value.total, names_to = "lag") %>%
separate(lag, into = c("drop", "Lag"), sep ="\\.")%>%
select(-drop) %>%
mutate(value = value +1) %>%# convert back to RR from AR
pivot_wider()%>% #summarise(max(`Daily mean temperature (C)`))
mutate(Cluster = factor(Cluster, levels = 1:9, labels = c("1: NE Coast", "2: NE", "3: Midwest", "4: SE Central", "5: W Coast",
"6: N Gulf", "7: SE Reach", "8: SW", "9: West" )),
`Daily mean temperature (C)`=temp_range ,
Lag = factor(Lag)) %>%
select(Cluster, temp_range, `Daily mean temperature (C)`, Lag, RR, RR_l = RR_lci , RR_h = RR_uci)
Next make the plot
y4_RR_tot_plot = cluster_rr_total_plot %>% filter(Lag == "total")%>%
ggplot(aes(x=`Daily mean temperature (C)`, y = RR ), color = "#5e3c99") +
geom_line( ) +
geom_ribbon(aes(ymin=RR_l,ymax=RR_h ),alpha=0.2, fill = "#5e3c99") +
ylim(.4, 1.7)+
ylab("Relative Risk") +
theme_classic(base_size = 14) +
facet_wrap(~Cluster)
y4_RR_tot_plot %>% print()
ggsave(filename=here("output/y4-final-manuscript-output/plots/2020-02-24-Manu-Fitted-DR-Fig//Y4fit_Facet-Cluster-RR-tot-15.6C.pdf"), plot =y4_RR_tot_plot, device = NULL, width = 7, height = 8)
ggsave(filename=here("output/y4-final-manuscript-output/plots/2020-02-24-Manu-Fitted-DR-Fig//Y4fit_Facet-Cluster-RR-tot-15.6C.png"), plot =y4_RR_tot_plot, device = NULL,width = 7, height = 8)
y4_RR_combine_plot <- cluster_rr_total_plot %>%
ggplot(aes(x=`Daily mean temperature (C)`, y = RR )) +
geom_line( aes( color = Lag) ) +
geom_ribbon(aes(ymin=RR_l, ymax=RR_h, fill = Lag),alpha=0.2) +
ylim(.4, 1.7)+
ylab("Relative Risk") +
scale_color_manual(values= c("#f46d43", "#2c7bb6", "#5e3c99")) +
theme_classic(base_size = 14) +
facet_wrap(~Cluster)
y4_RR_combine_plot %>% print()
ggsave(filename=here("output/y4-final-manuscript-output/plots/2020-02-24-Manu-Fitted-DR-Fig//Y4fit_Facet-Cluster-RR-all-15.6C.pdf"), plot =y4_RR_combine_plot, device = NULL, width = 7, height = 8)
ggsave(filename=here("output/y4-final-manuscript-output/plots/2020-02-24-Manu-Fitted-DR-Fig//Y4fit_Facet-Cluster-RR-all-15.6C.png"), plot =y4_RR_combine_plot, device = NULL,width = 7, height = 8)
devtools::session_info()
## - Session info ---------------------------------------------------------------
## setting value
## version R version 3.6.2 (2019-12-12)
## os Windows 10 x64
## system x86_64, mingw32
## ui RTerm
## language (EN)
## collate English_United States.1252
## ctype English_United States.1252
## tz America/Denver
## date 2020-02-24
##
## - Packages -------------------------------------------------------------------
## package * version date lib source
## assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.6.0)
## backports 1.1.5 2019-10-02 [1] CRAN (R 3.6.1)
## broom 0.5.4 2020-01-27 [1] CRAN (R 3.6.2)
## callr 3.4.2 2020-02-12 [1] CRAN (R 3.6.2)
## cellranger 1.1.0 2016-07-27 [1] CRAN (R 3.6.0)
## cli 2.0.1 2020-01-08 [1] CRAN (R 3.6.2)
## colorspace 1.4-1 2019-03-18 [1] CRAN (R 3.6.0)
## crayon 1.3.4 2017-09-16 [1] CRAN (R 3.6.0)
## data.table * 1.12.8 2019-12-09 [1] CRAN (R 3.6.2)
## DBI 1.1.0 2019-12-15 [1] CRAN (R 3.6.2)
## dbplyr 1.4.2 2019-06-17 [1] CRAN (R 3.6.2)
## desc 1.2.0 2018-05-01 [1] CRAN (R 3.6.1)
## devtools 2.2.2 2020-02-17 [1] CRAN (R 3.6.2)
## digest 0.6.24 2020-02-12 [1] CRAN (R 3.6.2)
## dlnm * 2.3.9 2019-03-11 [1] CRAN (R 3.6.0)
## dplyr * 0.8.4 2020-01-31 [1] CRAN (R 3.6.2)
## ellipsis 0.3.0 2019-09-20 [1] CRAN (R 3.6.2)
## evaluate 0.14 2019-05-28 [1] CRAN (R 3.6.2)
## fansi 0.4.1 2020-01-08 [1] CRAN (R 3.6.2)
## farver 2.0.3 2020-01-16 [1] CRAN (R 3.6.2)
## forcats * 0.4.0 2019-02-17 [1] CRAN (R 3.6.0)
## fs 1.3.1 2019-05-06 [1] CRAN (R 3.6.0)
## generics 0.0.2 2018-11-29 [1] CRAN (R 3.6.0)
## ggplot2 * 3.2.1 2019-08-10 [1] CRAN (R 3.6.2)
## glue 1.3.1 2019-03-12 [1] CRAN (R 3.6.0)
## gridExtra * 2.3 2017-09-09 [1] CRAN (R 3.6.0)
## gtable 0.3.0 2019-03-25 [1] CRAN (R 3.6.0)
## haven 2.2.0 2019-11-08 [1] CRAN (R 3.6.2)
## here * 0.1 2017-05-28 [1] CRAN (R 3.6.0)
## hms 0.5.3 2020-01-08 [1] CRAN (R 3.6.2)
## htmltools 0.4.0 2019-10-04 [1] CRAN (R 3.6.2)
## httr 1.4.1 2019-08-05 [1] CRAN (R 3.6.2)
## jsonlite 1.6.1 2020-02-02 [1] CRAN (R 3.6.2)
## knitr 1.28 2020-02-06 [1] CRAN (R 3.6.2)
## labeling 0.3 2014-08-23 [1] CRAN (R 3.6.0)
## lattice 0.20-38 2018-11-04 [2] CRAN (R 3.6.2)
## lazyeval 0.2.2 2019-03-15 [1] CRAN (R 3.6.0)
## lifecycle 0.1.0 2019-08-01 [1] CRAN (R 3.6.2)
## lubridate 1.7.4 2018-04-11 [1] CRAN (R 3.6.0)
## magrittr 1.5 2014-11-22 [1] CRAN (R 3.6.0)
## MASS * 7.3-51.5 2019-12-20 [1] CRAN (R 3.6.2)
## Matrix 1.2-18 2019-11-27 [2] CRAN (R 3.6.2)
## memoise 1.1.0 2017-04-21 [1] CRAN (R 3.6.1)
## mgcv * 1.8-31 2019-11-09 [1] CRAN (R 3.6.2)
## mixmeta 1.0.7 2019-12-09 [1] CRAN (R 3.6.2)
## modelr 0.1.5 2019-08-08 [1] CRAN (R 3.6.2)
## munsell 0.5.0 2018-06-12 [1] CRAN (R 3.6.0)
## mvmeta * 1.0.3 2019-12-10 [1] CRAN (R 3.6.2)
## nlme * 3.1-144 2020-02-06 [1] CRAN (R 3.6.2)
## pillar 1.4.3 2019-12-20 [1] CRAN (R 3.6.2)
## pkgbuild 1.0.6 2019-10-09 [1] CRAN (R 3.6.2)
## pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 3.6.2)
## pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.6.1)
## prettyunits 1.1.1 2020-01-24 [1] CRAN (R 3.6.2)
## processx 3.4.2 2020-02-09 [1] CRAN (R 3.6.2)
## ps 1.3.2 2020-02-13 [1] CRAN (R 3.6.2)
## purrr * 0.3.3 2019-10-18 [1] CRAN (R 3.6.2)
## R6 2.4.1 2019-11-12 [1] CRAN (R 3.6.2)
## Rcpp 1.0.3 2019-11-08 [1] CRAN (R 3.6.2)
## readr * 1.3.1 2018-12-21 [1] CRAN (R 3.6.0)
## readxl * 1.3.1 2019-03-13 [1] CRAN (R 3.6.0)
## remotes 2.1.1 2020-02-15 [1] CRAN (R 3.6.2)
## reprex 0.3.0 2019-05-16 [1] CRAN (R 3.6.0)
## rlang 0.4.4 2020-01-28 [1] CRAN (R 3.6.2)
## rmarkdown 2.1 2020-01-20 [1] CRAN (R 3.6.2)
## rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.6.0)
## rstudioapi 0.11 2020-02-07 [1] CRAN (R 3.6.2)
## rvest 0.3.5 2019-11-08 [1] CRAN (R 3.6.2)
## scales * 1.1.0 2019-11-18 [1] CRAN (R 3.6.2)
## sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.6.1)
## stringi 1.4.3 2019-03-12 [1] CRAN (R 3.6.0)
## stringr * 1.4.0 2019-02-10 [1] CRAN (R 3.6.0)
## survival * 3.1-8 2019-12-03 [1] CRAN (R 3.6.2)
## testthat 2.3.1 2019-12-01 [1] CRAN (R 3.6.2)
## tibble * 2.1.3 2019-06-06 [1] CRAN (R 3.6.2)
## tictoc * 1.0 2014-06-17 [1] CRAN (R 3.6.0)
## tidyr * 1.0.2 2020-01-24 [1] CRAN (R 3.6.2)
## tidyselect 1.0.0 2020-01-27 [1] CRAN (R 3.6.2)
## tidyverse * 1.3.0 2019-11-21 [1] CRAN (R 3.6.2)
## tsModel * 0.6 2013-06-24 [1] CRAN (R 3.6.0)
## usethis 1.5.1 2019-07-04 [1] CRAN (R 3.6.1)
## utf8 1.1.4 2018-05-24 [1] CRAN (R 3.6.0)
## vctrs 0.2.3 2020-02-20 [1] CRAN (R 3.6.2)
## viridisLite 0.3.0 2018-02-01 [1] CRAN (R 3.6.0)
## withr 2.1.2 2018-03-15 [1] CRAN (R 3.6.0)
## xfun 0.12 2020-01-13 [1] CRAN (R 3.6.2)
## xml2 1.2.2 2019-08-09 [1] CRAN (R 3.6.2)
## yaml 2.2.1 2020-02-01 [1] CRAN (R 3.6.2)
##
## [1] C:/Users/LayC/R.Lib
## [2] C:/Program Files/R/R-3.6.2/library
## [3] C:/Users/LayC/Documents/R/win-library/3.6