forked from appliedepi/epiRhandbook_eng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.R
38 lines (29 loc) · 952 Bytes
/
common.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# clear workspace
rm(list = ls(all = TRUE))
# clear all packages except base
#lapply(names(sessionInfo()$loadedOnly), require, character.only = TRUE)
#invisible(lapply(paste0('package:', names(sessionInfo()$otherPkgs)), detach, character.only=TRUE, unload=TRUE, force=TRUE))
# to ensure that tidyverse packages prevail
filter <- dplyr::filter
select <- dplyr::select
summarise <- dplyr::summarise
summary <- base::summary
incidence <- incidence2::incidence
#load core packages
pacman::p_load(
rio,
here,
DT,
stringr,
lubridate,
tidyverse
)
# import the cleaned ebola linelist
linelist <- rio::import(here::here("data", "case_linelists", "linelist_cleaned.rds"))
# import the count data - facility level
#count_data <- rio::import(here::here("data", "facility_count_data.rds"))
# Settings
options(scipen=1, digits=7)
# print only text (not code)
# library(knitr)
# opts_chunk$set(list(echo = FALSE, eval = FALSE))