1 Editorial and technical notes

In this page we describe the philosophical approach, style, and specific editorial decisions made during the creation of this handbook.

1.1 Approach and style

The potential audience for this book is large. It will surely be used by people very new to R, and also by experienced R users looking for best practices and tips. So it must be both accessible and succinct. Therefore, our approach was to provide just enough text explanation that someone very new to R can apply the code and follow what the code is doing.

A few other points:

  • This is a code reference book accompanied by relatively brief examples - not a thorough textbook on R or data science
  • This is a R handbook for use within applied epidemiology - not a manual on the methods or science of applied epidemiology
  • This is intended to be a living document - optimal R packages for a given task change often and we welcome discussion about which to emphasize in this handbook

R packages

So many choices

One of the most challenging aspects of learning R is knowing which R package to use for a given task. It is a common occurrence to struggle through a task only later to realize - hey, there’s an R package that does all that in one command line!

In this handbook, we try to offer you at least two ways to complete each task: one tried-and-true method (probably in base R or tidyverse) and one special R package that is custom-built for that purpose. We want you to have a couple options in case you can’t download a given package or it otherwise does not work for you.

In choosing which packages to use, we prioritized R packages and approaches that have been tested and vetted by the community, minimize the number of packages used in a typical work session, that are stable (not changing very often), and that accomplish the task simply and cleanly

This handbook generally prioritizes R packages and functions from the tidyverse. Tidyverse is a collection of R packages designed for data science that share underlying grammar and data structures. All tidyverse packages can be installed or loaded via the tidyverse package. Read more at the tidyverse website.

When applicable, we also offer code options using base R - the packages and functions that come with R at installation. This is because we recognize that some of this book’s audience may not have reliable internet to download extra packages.

Linking functions to packages explicitly

It is often frustrating in R tutorials when a function is shown in code, but you don’t know which package it is from! We try to avoid this situation.

In the narrative text, package names are written in bold (e.g. dplyr) and functions are written like this: mutate(). We strive to be explicit about which package a function comes from, either by referencing the package in nearby text or by specifying the package explicitly in the code like this: dplyr::mutate(). It may look redundant, but we are doing it on purpose.

See the page on R basics to learn more about packages and functions.

Code style

In the handbook, we frequently utilize “new lines”, making our code appear “long”. We do this for a few reasons:

  • We can write explanatory comments with # that are adjacent to each little part of the code
  • Generally, longer (vertical) code is easier to read
  • It is easier to read on a narrow screen (no sideways scrolling needed)
  • From the indentations, it can be easier to know which arguments belong to which function

As a result, code that could be written like this:

linelist %>% 
  group_by(hospital) %>%  # group rows by hospital
  slice_max(date, n = 1, with_ties = F) # if there's a tie (of date), take the first row

…is written like this:

linelist %>% 
  group_by(hospital) %>% # group rows by hospital
  slice_max(
    date,                # keep row per group with maximum date value 
    n = 1,               # keep only the single highest row 
    with_ties = F)       # if there's a tie (of date), take the first row

R code is generally not affected by new lines or indentations. When writing code, if you initiate a new line after a comma it will apply automatic indentation patterns.

We also use lots of spaces (e.g. n = 1 instead of n=1) because it is easier to read. Be kind to the people reading your code!

Nomenclature

In this handbook, we generally reference “columns” and “rows” instead of “variables” and “observations”. As explained in this primer on “tidy data”, most epidemiological statistical datasets consist structurally of rows, columns, and values.

Variables contain the values that measure the same underlying attribute (like age group, outcome, or date of onset). Observations contain all values measured on the same unit (e.g. a person, site, or lab sample). So these aspects can be more difficult to tangibly define.

In “tidy” datasets, each column is a variable, each row is an observation, and each cell is a single value. However some datasets you encounter will not fit this mold - a “wide” format dataset may have a variable split across several columns (see an example in the Pivoting data page). Likewise, observations could be split across several rows.

Most of this handbook is about managing and transforming data, so referring to the concrete data structures of rows and columns is more relevant than the more abstract observations and variables. Exceptions occur primarily in pages on data analysis, where you will see more references to variables and observations.

Notes

Here are the types of notes you may encounter in the handbook:

NOTE: This is a note
TIP: This is a tip.
CAUTION: This is a cautionary note.
DANGER: This is a warning.

1.2 Editorial decisions

Below, we track significant editorial decisions around package and function choice. If you disagree or want to offer a new tool for consideration, please join/start a conversation on our Github page.

Table of package, function, and other editorial decisions

Subject Considered Outcome Brief rationale
General coding approach tidyverse, data.table, base tidyverse, with a page on data.table, and mentions of base alternatives for readers with no internet tidyverse readability, universality, most-taught
Package loading library(),install.packages(), require(), pacman pacman Shortens and simplifies code for most multi-package install/load use-cases
Import and export rio, many other packages rio Ease for many file types
Grouping for summary statistics dplyr group_by(), stats aggregate() dplyr group_by() Consistent with tidyverse emphasis
Pivoting tidyr (pivot functions), reshape2 (melt/cast), tidyr (spread/gather) tidyr (pivot functions) reshape2 is retired, tidyr uses pivot functions as of v1.0.0
Clean column names linelist, janitor janitor Consolidation of packages emphasized
Epiweeks lubridate, aweek, tsibble, zoo lubridate generally, the others for specific cases lubridate’s flexibility, consistency, package maintenance prospects
ggplot labels labs(), ggtitle()/ylab()/xlab() labs() all labels in one place, simplicity
Convert to factor factor(), forcats forcats its various functions also convert to factor in same command
Epidemic curves incidence, ggplot2, EpiCurve incidence2 as quick, ggplot2 as detailed dependability
Concatenation paste(), paste0(), str_glue(), glue() str_glue() More simple syntax than paste functions; within stringr

1.3 Major revisions

Date Major changes
10 May 2021 Release of version 1.0.0

1.4 Session info (R, RStudio, packages)

Below is the information on the versions of R, RStudio, and R packages used during this rendering of the Handbook.

sessioninfo::session_info()
## - Session info ----------------------------------------------------------------------------------------------------------------------------------------------------
##  setting  value                       
##  version  R version 4.1.0 (2021-05-18)
##  os       Windows 10 x64              
##  system   x86_64, mingw32             
##  ui       RStudio                     
##  language (EN)                        
##  collate  English_United States.1252  
##  ctype    English_United States.1252  
##  tz       America/New_York            
##  date     2021-09-01                  
## 
## - Packages --------------------------------------------------------------------------------------------------------------------------------------------------------
##  ! package              * version     date       lib source                               
##    abind                * 1.4-5       2016-07-21 [1] CRAN (R 4.0.0)                       
##    ada                    2.0-5       2016-05-13 [1] CRAN (R 4.0.3)                       
##    adagio                 0.8.4       2021-04-30 [1] CRAN (R 4.1.0)                       
##    ade4                   1.7-16      2020-10-28 [1] CRAN (R 4.0.3)                       
##    anytime                0.3.9       2020-08-27 [1] CRAN (R 4.0.2)                       
##    ape                  * 5.5         2021-04-25 [1] CRAN (R 4.1.0)                       
##    aplot                  0.0.6       2020-09-03 [1] CRAN (R 4.0.3)                       
##    apyramid             * 0.1.2       2020-05-08 [1] CRAN (R 4.0.2)                       
##    assertive.base         0.0-9       2021-02-08 [1] CRAN (R 4.1.0)                       
##    assertive.properties   0.0-4       2016-12-30 [1] CRAN (R 4.1.0)                       
##    assertive.types        0.0-3       2016-12-30 [1] CRAN (R 4.1.0)                       
##    assertthat             0.2.1       2019-03-21 [1] CRAN (R 4.0.0)                       
##    aweek                * 1.0.2       2021-01-04 [1] CRAN (R 4.0.3)                       
##    backports              1.2.1       2020-12-09 [1] CRAN (R 4.0.3)                       
##    base64enc              0.1-3       2015-07-28 [1] CRAN (R 4.0.0)                       
##    bayestestR             0.10.0      2021-05-31 [1] CRAN (R 4.1.0)                       
##    BiocManager            1.30.15     2021-05-11 [1] CRAN (R 4.1.0)                       
##    bit                  * 4.0.4       2020-08-04 [1] CRAN (R 4.0.3)                       
##    bit64                  4.0.5       2020-08-30 [1] CRAN (R 4.0.3)                       
##    blob                   1.2.1       2020-01-20 [1] CRAN (R 4.0.2)                       
##    bookdown               0.22        2021-04-22 [1] CRAN (R 4.1.0)                       
##    boot                 * 1.3-28      2021-05-03 [1] CRAN (R 4.1.0)                       
##    broom                * 0.7.6       2021-04-05 [1] CRAN (R 4.0.5)                       
##    broom.helpers          1.3.0       2021-04-10 [1] CRAN (R 4.1.0)                       
##    bslib                  0.2.5.1     2021-05-18 [1] CRAN (R 4.0.5)                       
##    cachem                 1.0.5       2021-05-15 [1] CRAN (R 4.0.5)                       
##    callr                  3.7.0       2021-04-20 [1] CRAN (R 4.0.5)                       
##    car                    3.0-10      2020-09-29 [1] CRAN (R 4.0.3)                       
##    carData                3.0-4       2020-05-22 [1] CRAN (R 4.0.0)                       
##    cellranger             1.1.0       2016-07-27 [1] CRAN (R 4.0.0)                       
##    checkmate              2.0.0       2020-02-06 [1] CRAN (R 4.0.2)                       
##    class                  7.3-19      2021-05-03 [1] CRAN (R 4.1.0)                       
##    classInt               0.4-3       2020-04-07 [1] CRAN (R 4.0.0)                       
##    cli                    3.0.0       2021-06-30 [1] CRAN (R 4.1.0)                       
##    clock                  0.3.0       2021-04-22 [1] CRAN (R 4.0.5)                       
##    cmprsk                 2.2-10      2020-06-09 [1] CRAN (R 4.0.4)                       
##    coarseDataTools        0.6-5       2019-12-06 [1] CRAN (R 4.0.2)                       
##    coda                   0.19-4      2020-09-30 [1] CRAN (R 4.0.3)                       
##    codetools              0.2-18      2020-11-04 [1] CRAN (R 4.1.0)                       
##    colorspace             2.0-2       2021-06-24 [1] CRAN (R 4.1.0)                       
##    commonmark             1.7         2018-12-01 [1] CRAN (R 4.0.2)                       
##    conquer                1.0.2       2020-08-27 [1] CRAN (R 4.0.2)                       
##    corrr                * 0.4.3       2020-11-24 [1] CRAN (R 4.0.3)                       
##    cowplot              * 1.1.1       2020-12-30 [1] CRAN (R 4.0.3)                       
##    crayon                 1.4.1       2021-02-08 [1] CRAN (R 4.0.4)                       
##    crosstalk              1.1.1       2021-01-12 [1] CRAN (R 4.0.3)                       
##    curl                   4.3.2       2021-06-23 [1] CRAN (R 4.1.0)                       
##    curry                  0.1.1       2016-09-28 [1] CRAN (R 4.1.0)                       
##    data.table           * 1.14.0      2021-02-21 [1] CRAN (R 4.0.4)                       
##    DBI                  * 1.1.1       2021-01-15 [1] CRAN (R 4.0.3)                       
##    dbplyr                 2.1.1       2021-04-06 [1] CRAN (R 4.0.5)                       
##    deldir                 0.2-10      2021-02-16 [1] CRAN (R 4.0.4)                       
##    Deriv                  4.1.3       2021-02-24 [1] CRAN (R 4.0.5)                       
##    DiagrammeR           * 1.0.6.1     2020-05-08 [1] CRAN (R 4.0.3)                       
##    dichromat              2.0-0       2013-01-24 [1] CRAN (R 4.0.3)                       
##    digest                 0.6.27      2020-10-24 [1] CRAN (R 4.1.0)                       
##    distcrete            * 1.0.3       2017-11-23 [1] CRAN (R 4.0.2)                       
##    distributional         0.2.2       2021-02-02 [1] CRAN (R 4.0.3)                       
##    doBy                 * 4.6.10      2021-04-29 [1] CRAN (R 4.1.0)                       
##    doParallel             1.0.16      2020-10-16 [1] CRAN (R 4.0.3)                       
##    downlit                0.2.1       2020-11-04 [1] CRAN (R 4.0.3)                       
##    dplyr                * 1.0.6       2021-05-05 [1] CRAN (R 4.1.0)                       
##    dsr                  * 0.2.2       2019-08-23 [1] CRAN (R 4.0.2)                       
##    DT                   * 0.18        2021-04-14 [1] CRAN (R 4.1.0)                       
##    e1071                  1.7-7       2021-05-23 [1] CRAN (R 4.1.0)                       
##    ecmwfr               * 1.3.0       2020-07-13 [1] CRAN (R 4.0.3)                       
##    effectsize             0.4.5       2021-05-25 [1] CRAN (R 4.1.0)                       
##    ellipsis               0.3.2       2021-04-29 [1] CRAN (R 4.1.0)                       
##    Epi                  * 2.44        2021-02-27 [1] CRAN (R 4.0.4)                       
##    epibuffet              0.0.0.9005  2021-07-12 [1] Github (R4EPI/epibuffet@39cbc7e)     
##    epicontacts          * 1.2.0       2021-05-30 [1] Github (reconhub/epicontacts@facf491)
##    epidict                0.0.0.9001  2021-07-12 [1] Github (R4EPI/epidict@1893db0)       
##    EpiEstim             * 2.2-4       2021-01-07 [1] CRAN (R 4.0.3)                       
##    epikit               * 0.1.2       2021-04-29 [1] Github (R4EPI/epikit@9267b80)        
##    EpiNow2              * 1.3.2       2020-12-14 [1] CRAN (R 4.1.0)                       
##    epitrix              * 0.2.2       2019-01-15 [1] CRAN (R 4.0.2)                       
##    etm                    1.1.1       2020-09-08 [1] CRAN (R 4.0.4)                       
##    evaluate               0.14        2019-05-28 [1] CRAN (R 4.1.0)                       
##    evd                    2.3-3       2018-04-25 [1] CRAN (R 4.0.3)                       
##    expm                   0.999-6     2021-01-13 [1] CRAN (R 4.0.5)                       
##    fabletools           * 0.3.1       2021-03-16 [1] CRAN (R 4.0.5)                       
##    FactoClass             1.2.7       2018-10-01 [1] CRAN (R 4.0.3)                       
##    fansi                  0.5.0       2021-05-25 [1] CRAN (R 4.1.0)                       
##    farver                 2.1.0       2021-02-28 [1] CRAN (R 4.1.0)                       
##    fastLink             * 0.6.0       2020-04-29 [1] CRAN (R 4.1.0)                       
##    fastmap                1.1.0       2021-01-25 [1] CRAN (R 4.1.0)                       
##    feasts               * 0.2.1       2021-03-22 [1] CRAN (R 4.0.5)                       
##    ff                   * 4.0.4       2020-10-13 [1] CRAN (R 4.0.3)                       
##    fitdistrplus           1.1-5       2021-05-28 [1] CRAN (R 4.1.0)                       
##    flexdashboard        * 0.5.2       2020-06-24 [1] CRAN (R 4.0.5)                       
##    flextable            * 0.6.6       2021-05-17 [1] CRAN (R 4.1.0)                       
##    forcats              * 0.5.1       2021-01-27 [1] CRAN (R 4.1.0)                       
##    foreach                1.5.1       2020-10-15 [1] CRAN (R 4.0.3)                       
##    forecast             * 8.14        2021-03-11 [1] CRAN (R 4.1.0)                       
##    foreign                0.8-81      2020-12-22 [1] CRAN (R 4.1.0)                       
##    formatR                1.10        2021-05-25 [1] CRAN (R 4.1.0)                       
##    formattable          * 0.2.1       2021-01-07 [1] CRAN (R 4.0.3)                       
##    Formula              * 1.2-4       2020-10-16 [1] CRAN (R 4.0.3)                       
##    fracdiff               1.5-1       2020-01-24 [1] CRAN (R 4.0.2)                       
##    frailtypack          * 3.3.2       2020-10-14 [1] CRAN (R 4.1.0)                       
##    fs                   * 1.5.0       2020-07-31 [1] CRAN (R 4.1.0)                       
##    futile.logger          1.4.3       2016-07-10 [1] CRAN (R 4.0.3)                       
##    futile.options         1.0.1       2018-04-20 [1] CRAN (R 4.0.3)                       
##    future                 1.21.0      2020-12-10 [1] CRAN (R 4.0.3)                       
##    future.apply           1.7.0       2021-01-04 [1] CRAN (R 4.0.3)                       
##    gdata                  2.18.0      2017-06-06 [1] CRAN (R 4.0.5)                       
##    gdtools                0.2.3       2021-01-06 [1] CRAN (R 4.0.3)                       
##    generics               0.1.0       2020-10-31 [1] CRAN (R 4.1.0)                       
##    ggExtra              * 0.9         2019-08-27 [1] CRAN (R 4.0.4)                       
##    ggforce              * 0.3.3       2021-03-05 [1] CRAN (R 4.1.0)                       
##    gghighlight          * 0.3.1       2020-12-12 [1] CRAN (R 4.0.3)                       
##    ggnewscale           * 0.4.5       2021-01-11 [1] CRAN (R 4.0.3)                       
##    ggplot2              * 3.3.5       2021-06-25 [1] CRAN (R 4.1.0)                       
##    ggpubr               * 0.4.0       2020-06-27 [1] CRAN (R 4.1.0)                       
##    ggrepel              * 0.9.1       2021-01-15 [1] CRAN (R 4.0.3)                       
##    ggridges               0.5.3       2021-01-08 [1] CRAN (R 4.0.3)                       
##    ggsignif               0.6.1       2021-02-23 [1] CRAN (R 4.0.5)                       
##    ggtext                 0.1.1       2020-12-17 [1] CRAN (R 4.0.3)                       
##    ggtree               * 3.0.1       2021-05-25 [1] Bioconductor                         
##    ggupset              * 0.3.0       2020-05-05 [1] CRAN (R 4.0.2)                       
##    globals                0.14.0      2020-11-22 [1] CRAN (R 4.0.3)                       
##    glue                   1.4.2       2020-08-27 [1] CRAN (R 4.1.0)                       
##    gmodels                2.18.1      2018-06-25 [1] CRAN (R 4.0.5)                       
##    goftest                1.2-2       2019-12-02 [1] CRAN (R 4.0.3)                       
##    grates                 0.2.0       2021-05-28 [1] CRAN (R 4.1.0)                       
##    gridExtra              2.3         2017-09-09 [1] CRAN (R 4.1.0)                       
##    gridtext               0.1.4       2020-12-10 [1] CRAN (R 4.0.3)                       
##    gt                     0.3.0       2021-05-12 [1] CRAN (R 4.1.0)                       
##    gtable                 0.3.0       2019-03-25 [1] CRAN (R 4.1.0)                       
##    gtools                 3.8.2       2020-03-31 [1] CRAN (R 4.0.3)                       
##    gtsummary            * 1.4.1       2021-05-19 [1] CRAN (R 4.1.0)                       
##    haven                  2.4.1       2021-04-23 [1] CRAN (R 4.1.0)                       
##    here                 * 1.0.1       2020-12-13 [1] CRAN (R 4.0.3)                       
##    highcharter          * 0.8.2       2020-07-26 [1] CRAN (R 4.0.5)                       
##    highr                  0.9         2021-04-16 [1] CRAN (R 4.1.0)                       
##    hms                    1.1.0       2021-05-17 [1] CRAN (R 4.1.0)                       
##    htmltools              0.5.1.1     2021-01-22 [1] CRAN (R 4.1.0)                       
##    htmlwidgets            1.5.3       2020-12-10 [1] CRAN (R 4.1.0)                       
##    httpuv                 1.6.1       2021-05-07 [1] CRAN (R 4.1.0)                       
##    httr                   1.4.2       2020-07-20 [1] CRAN (R 4.1.0)                       
##    i2extras             * 0.1.0       2021-03-30 [1] CRAN (R 4.1.0)                       
##    igraph                 1.2.6       2020-10-06 [1] CRAN (R 4.1.0)                       
##    imputeTS             * 3.2         2021-01-16 [1] CRAN (R 4.1.0)                       
##    incidence              1.7.3       2020-11-04 [1] CRAN (R 4.0.3)                       
##    incidence2           * 1.1         2021-05-29 [1] CRAN (R 4.1.0)                       
##    inline                 0.3.19      2021-05-31 [1] CRAN (R 4.1.0)                       
##    insight                0.14.1      2021-05-28 [1] CRAN (R 4.1.0)                       
##    ipred                  0.9-11      2021-03-12 [1] CRAN (R 4.0.5)                       
##    isoband                0.2.4       2021-03-03 [1] CRAN (R 4.1.0)                       
##    iterators              1.0.13      2020-10-15 [1] CRAN (R 4.0.3)                       
##    janitor              * 2.1.0       2021-01-05 [1] CRAN (R 4.0.3)                       
##    jpeg                   0.1-8.1     2019-10-24 [1] CRAN (R 4.0.0)                       
##    jquerylib              0.1.4       2021-04-26 [1] CRAN (R 4.1.0)                       
##    jsonlite               1.7.2       2020-12-09 [1] CRAN (R 4.1.0)                       
##    kableExtra           * 1.3.4       2021-02-20 [1] CRAN (R 4.0.5)                       
##    KernSmooth             2.23-20     2021-05-03 [1] CRAN (R 4.1.0)                       
##    km.ci                  0.5-2       2009-08-30 [1] CRAN (R 4.0.4)                       
##    KMsurv                 0.1-5       2012-12-03 [1] CRAN (R 4.0.3)                       
##    knitr                  1.33        2021-04-24 [1] CRAN (R 4.1.0)                       
##    labeling               0.4.2       2020-10-20 [1] CRAN (R 4.1.0)                       
##    labelled               2.8.0       2021-03-08 [1] CRAN (R 4.1.0)                       
##    lambda.r               1.2.4       2019-09-18 [1] CRAN (R 4.0.3)                       
##    later                  1.2.0       2021-04-23 [1] CRAN (R 4.1.0)                       
##    lattice                0.20-44     2021-05-02 [1] CRAN (R 4.1.0)                       
##    lava                   1.6.9       2021-03-11 [1] CRAN (R 4.0.5)                       
##    lazyeval               0.2.2       2019-03-15 [1] CRAN (R 4.1.0)                       
##    leafem                 0.1.6       2021-05-24 [1] CRAN (R 4.1.0)                       
##    leaflet                2.0.4.1     2021-01-07 [1] CRAN (R 4.0.3)                       
##    leaflet.providers      1.9.0       2019-11-09 [1] CRAN (R 4.0.3)                       
##    leafsync               0.1.0       2019-03-05 [1] CRAN (R 4.0.3)                       
##    LearnBayes             2.15.1      2018-03-18 [1] CRAN (R 4.0.3)                       
##    lifecycle              1.0.0       2021-02-15 [1] CRAN (R 4.1.0)                       
##    linelist             * 0.0.40.9000 2020-09-18 [1] Github (reconhub/linelist@cae034d)   
##    listenv                0.8.0       2019-12-05 [1] CRAN (R 4.0.2)                       
##    lmtest               * 0.9-38      2020-09-09 [1] CRAN (R 4.0.2)                       
##    loo                    2.4.1       2020-12-09 [1] CRAN (R 4.0.3)                       
##    lpSolve                5.6.15      2020-01-24 [1] CRAN (R 4.1.0)                       
##    lubridate            * 1.7.10      2021-02-26 [1] CRAN (R 4.0.5)                       
##    lwgeom                 0.2-6       2021-04-02 [1] CRAN (R 4.0.5)                       
##    magrittr             * 2.0.1       2020-11-17 [1] CRAN (R 4.1.0)                       
##    markdown               1.1         2019-08-07 [1] CRAN (R 4.1.0)                       
##    MASS                 * 7.3-54      2021-05-03 [1] CRAN (R 4.1.0)                       
##    matchmaker             0.1.1       2020-02-21 [1] CRAN (R 4.0.2)                       
##    Matrix               * 1.3-4       2021-06-01 [1] CRAN (R 4.1.0)                       
##    MatrixModels           0.5-0       2021-03-02 [1] CRAN (R 4.0.5)                       
##    matrixStats            0.58.0      2021-01-29 [1] CRAN (R 4.1.0)                       
##    mcmc                   0.9-7       2020-03-21 [1] CRAN (R 4.0.2)                       
##    MCMCpack               1.5-0       2021-01-20 [1] CRAN (R 4.1.0)                       
##    memoise                2.0.0       2021-01-26 [1] CRAN (R 4.1.0)                       
##    mgcv                   1.8-36      2021-06-01 [1] CRAN (R 4.1.0)                       
##    mice                 * 3.13.0      2021-01-27 [1] CRAN (R 4.0.3)                       
##    microbenchmark         1.4-7       2019-09-24 [1] CRAN (R 4.1.0)                       
##    mime                   0.11        2021-06-23 [1] CRAN (R 4.1.0)                       
##    miniUI                 0.1.1.1     2018-05-18 [1] CRAN (R 4.0.4)                       
##    mitools                2.4         2019-04-26 [1] CRAN (R 4.0.0)                       
##    modelr                 0.1.8       2020-05-19 [1] CRAN (R 4.0.2)                       
##    munsell                0.5.0       2018-06-12 [1] CRAN (R 4.1.0)                       
##    naniar               * 0.6.1       2021-05-14 [1] CRAN (R 4.1.0)                       
##    networkD3            * 0.4         2017-03-18 [1] CRAN (R 4.1.0)                       
##    nlme                   3.1-152     2021-02-04 [1] CRAN (R 4.1.0)                       
##    nnet                   7.3-16      2021-05-03 [1] CRAN (R 4.1.0)                       
##    numDeriv               2016.8-1.1  2019-06-06 [1] CRAN (R 4.1.0)                       
##    officer              * 0.3.18      2021-04-02 [1] CRAN (R 4.1.0)                       
##    OpenStreetMap        * 0.3.4       2019-05-31 [1] CRAN (R 4.1.1)                       
##    openxlsx               4.2.3       2020-10-27 [1] CRAN (R 4.1.0)                       
##    pacman                 0.5.1       2019-03-11 [1] CRAN (R 4.1.0)                       
##    parallelly             1.25.0      2021-04-30 [1] CRAN (R 4.1.0)                       
##    parameters           * 0.14.0      2021-05-29 [1] CRAN (R 4.1.0)                       
##    patchwork            * 1.1.1       2020-12-17 [1] CRAN (R 4.1.0)                       
##    PerformanceAnalytics * 2.0.4       2020-02-06 [1] CRAN (R 4.1.0)                       
##    PHEindicatormethods  * 1.3.2       2020-06-25 [1] CRAN (R 4.1.0)                       
##    pillar                 1.6.1       2021-05-16 [1] CRAN (R 4.1.0)                       
##    pkgbuild               1.2.0       2020-12-15 [1] CRAN (R 4.1.0)                       
##    pkgconfig              2.0.3       2019-09-22 [1] CRAN (R 4.1.0)                       
##    plotly               * 4.9.3       2021-01-10 [1] CRAN (R 4.1.0)                       
##    plotrix                3.8-1       2021-01-21 [1] CRAN (R 4.1.0)                       
##    plyr                   1.8.6       2020-03-03 [1] CRAN (R 4.1.0)                       
##    png                    0.1-7       2013-12-03 [1] CRAN (R 4.1.0)                       
##    polyclip               1.10-0      2019-03-14 [1] CRAN (R 4.1.0)                       
##    polyCub                0.8.0       2021-01-27 [1] CRAN (R 4.1.0)                       
##    prettyunits            1.1.1       2020-01-24 [1] CRAN (R 4.1.0)                       
##    pROC                   1.17.0.1    2021-01-13 [1] CRAN (R 4.1.0)                       
##    processx               3.5.2       2021-04-30 [1] CRAN (R 4.1.0)                       
##    prodlim                2019.11.13  2019-11-17 [1] CRAN (R 4.1.0)                       
##    progress               1.2.2       2019-05-16 [1] CRAN (R 4.1.0)                       
##    progressr              0.7.0       2020-12-11 [1] CRAN (R 4.1.0)                       
##    projections          * 0.5.4       2021-04-22 [1] CRAN (R 4.1.0)                       
##    promises               1.2.0.1     2021-02-11 [1] CRAN (R 4.1.0)                       
##    proxy                  0.4-26      2021-06-07 [1] CRAN (R 4.1.0)                       
##    ps                     1.6.0       2021-02-28 [1] CRAN (R 4.1.0)                       
##    purrr                * 0.3.4       2020-04-17 [1] CRAN (R 4.1.0)                       
##    quadprog               1.5-8       2019-11-20 [1] CRAN (R 4.1.0)                       
##    Quandl                 2.10.0      2019-06-12 [1] CRAN (R 4.1.0)                       
##    quantmod             * 0.4.18      2020-12-09 [1] CRAN (R 4.1.0)                       
##    quantreg               5.85        2021-02-24 [1] CRAN (R 4.1.0)                       
##    R.methodsS3            1.8.1       2020-08-26 [1] CRAN (R 4.1.0)                       
##    R.oo                   1.24.0      2020-08-26 [1] CRAN (R 4.1.0)                       
##    R.utils                2.10.1      2020-08-26 [1] CRAN (R 4.1.0)                       
##    R6                     2.5.0       2020-10-28 [1] CRAN (R 4.1.0)                       
##    raster                 3.4-10      2021-05-03 [1] CRAN (R 4.1.0)                       
##    RColorBrewer         * 1.1-2       2014-12-07 [1] CRAN (R 4.1.0)                       
##    Rcpp                 * 1.0.6       2021-01-15 [1] CRAN (R 4.1.0)                       
##  D RcppParallel           5.1.4       2021-05-04 [1] CRAN (R 4.1.0)                       
##    readr                * 1.4.0       2020-10-05 [1] CRAN (R 4.1.0)                       
##    readxl               * 1.3.1       2019-03-13 [1] CRAN (R 4.1.0)                       
##    RecordLinkage        * 0.4-12.1    2020-08-25 [1] CRAN (R 4.1.0)                       
##    remotes                2.3.0       2021-04-01 [1] CRAN (R 4.1.0)                       
##    renv                   0.13.2      2021-03-30 [1] CRAN (R 4.1.0)                       
##    repr                   1.1.3       2021-01-21 [1] CRAN (R 4.1.0)                       
##    reprex                 2.0.0       2021-04-02 [1] CRAN (R 4.1.0)                       
##    reshape2               1.4.4       2020-04-09 [1] CRAN (R 4.1.0)                       
##    rgdal                  1.5-23      2021-02-03 [1] CRAN (R 4.1.0)                       
##    rio                  * 0.5.26      2021-03-01 [1] CRAN (R 4.1.0)                       
##  D rJava                  1.0-4       2021-04-29 [1] CRAN (R 4.1.0)                       
##    rlang                  0.4.11      2021-04-30 [1] CRAN (R 4.1.0)                       
##    rlist                  0.4.6.1     2016-04-04 [1] CRAN (R 4.1.0)                       
##    rmarkdown              2.9         2021-06-15 [1] CRAN (R 4.1.0)                       
##    rootSolve              1.8.2.1     2020-04-27 [1] CRAN (R 4.1.0)                       
##    rpart                  4.1-15      2019-04-12 [1] CRAN (R 4.1.0)                       
##    rprojroot              2.0.2       2020-11-15 [1] CRAN (R 4.1.0)                       
##    RSQLite              * 2.2.7       2021-04-22 [1] CRAN (R 4.1.0)                       
##    rstan                  2.21.2      2020-07-27 [1] CRAN (R 4.1.0)                       
##    rstatix              * 0.7.0       2021-02-13 [1] CRAN (R 4.1.0)                       
##    rstudioapi             0.13        2020-11-12 [1] CRAN (R 4.1.0)                       
##    runner                 0.4.0       2021-04-22 [1] CRAN (R 4.1.0)                       
##    rvcheck                0.1.8       2020-03-01 [1] CRAN (R 4.1.0)                       
##    rvest                  1.0.0       2021-03-09 [1] CRAN (R 4.1.0)                       
##    s2                     1.0.6       2021-06-17 [1] CRAN (R 4.1.0)                       
##    sass                   0.4.0       2021-05-12 [1] CRAN (R 4.1.0)                       
##    scales               * 1.1.1       2020-05-11 [1] CRAN (R 4.1.0)                       
##    scatterplot3d          0.3-41      2018-03-14 [1] CRAN (R 4.0.3)                       
##    see                  * 0.6.4       2021-05-29 [1] CRAN (R 4.1.0)                       
##    SemiCompRisks        * 3.4         2021-02-03 [1] CRAN (R 4.0.4)                       
##    sessioninfo            1.1.1       2018-11-05 [1] CRAN (R 4.1.0)                       
##    sf                   * 1.0-1       2021-06-29 [1] CRAN (R 4.1.0)                       
##    shiny                * 1.6.0       2021-01-25 [1] CRAN (R 4.1.0)                       
##    sitrep               * 0.1.7       2021-07-12 [1] Github (R4EPI/sitrep@9a57f33)        
##    skimr                * 2.1.3       2021-03-07 [1] CRAN (R 4.1.0)                       
##    slider               * 0.2.1       2021-03-23 [1] CRAN (R 4.0.5)                       
##    snakecase              0.11.0      2019-05-25 [1] CRAN (R 4.1.0)                       
##    sp                   * 1.4-5       2021-01-10 [1] CRAN (R 4.1.0)                       
##    SparseM                1.81        2021-02-18 [1] CRAN (R 4.1.0)                       
##    spatstat               2.1-0       2021-04-03 [1] CRAN (R 4.0.5)                       
##    spatstat.core          2.1-2       2021-04-18 [1] CRAN (R 4.1.0)                       
##    spatstat.data          2.1-0       2021-03-21 [1] CRAN (R 4.0.5)                       
##    spatstat.geom          2.1-0       2021-04-15 [1] CRAN (R 4.1.0)                       
##    spatstat.linnet        2.1-1       2021-03-28 [1] CRAN (R 4.0.5)                       
##    spatstat.sparse        2.0-0       2021-03-16 [1] CRAN (R 4.0.5)                       
##    spatstat.utils         2.1-0       2021-03-15 [1] CRAN (R 4.0.5)                       
##    spData               * 0.3.8       2020-07-03 [1] CRAN (R 4.0.5)                       
##    spdep                * 1.1-8       2021-05-23 [1] CRAN (R 4.1.0)                       
##    srvyr                * 1.0.1       2021-03-28 [1] CRAN (R 4.0.5)                       
##    StanHeaders            2.21.0-7    2020-12-17 [1] CRAN (R 4.0.3)                       
##    stars                * 0.5-2       2021-03-17 [1] CRAN (R 4.1.0)                       
##    statmod                1.4.36      2021-05-10 [1] CRAN (R 4.1.0)                       
##    stinepack              1.4         2018-07-30 [1] CRAN (R 4.0.3)                       
##    stringdist           * 0.9.6.3     2020-10-09 [1] CRAN (R 4.0.3)                       
##    stringi                1.6.2       2021-05-17 [1] CRAN (R 4.1.0)                       
##    stringr              * 1.4.0       2019-02-10 [1] CRAN (R 4.1.0)                       
##    survC1               * 1.0-3       2021-02-10 [1] CRAN (R 4.1.0)                       
##    surveillance         * 1.19.1      2021-03-31 [1] CRAN (R 4.1.0)                       
##    survey               * 4.0         2020-04-03 [1] CRAN (R 4.0.0)                       
##    survival             * 3.2-11      2021-04-26 [1] CRAN (R 4.1.0)                       
##    survminer            * 0.4.9       2021-03-09 [1] CRAN (R 4.0.5)                       
##    survMisc               0.5.5       2018-07-05 [1] CRAN (R 4.0.4)                       
##    svglite                2.0.0       2021-02-20 [1] CRAN (R 4.0.5)                       
##    systemfonts            1.0.2       2021-05-11 [1] CRAN (R 4.1.0)                       
##    tensor                 1.5         2012-05-05 [1] CRAN (R 4.1.0)                       
##    tibble               * 3.1.2       2021-05-16 [1] CRAN (R 4.1.0)                       
##    tidyquant            * 1.0.3       2021-03-05 [1] CRAN (R 4.1.0)                       
##    tidyr                * 1.1.3       2021-03-03 [1] CRAN (R 4.1.0)                       
##    tidyselect             1.1.1       2021-04-30 [1] CRAN (R 4.1.0)                       
##    tidytree               0.3.4       2021-05-22 [1] CRAN (R 4.1.0)                       
##    tidyverse            * 1.3.1       2021-04-15 [1] CRAN (R 4.1.0)                       
##    timeDate               3043.102    2018-02-21 [1] CRAN (R 4.1.0)                       
##    tmap                 * 3.3-1       2021-03-15 [1] CRAN (R 4.1.0)                       
##    tmaptools            * 3.1-1       2021-01-19 [1] CRAN (R 4.1.0)                       
##    treeio               * 1.16.1      2021-05-23 [1] Bioconductor                         
##    trending             * 0.0.3       2021-04-19 [1] CRAN (R 4.1.0)                       
##    truncnorm              1.0-8       2018-02-27 [1] CRAN (R 4.1.0)                       
##    tseries                0.10-48     2020-12-04 [1] CRAN (R 4.1.0)                       
##    tsibble              * 1.0.1       2021-04-12 [1] CRAN (R 4.1.0)                       
##    TTR                  * 0.24.2      2020-09-01 [1] CRAN (R 4.1.0)                       
##    tweenr                 1.0.2       2021-03-23 [1] CRAN (R 4.1.0)                       
##    tzdb                   0.1.1       2021-04-22 [1] CRAN (R 4.1.0)                       
##    units                * 0.7-2       2021-06-08 [1] CRAN (R 4.1.0)                       
##    UpSetR               * 1.4.0       2019-05-22 [1] CRAN (R 4.1.0)                       
##    urca                   1.3-0       2016-09-06 [1] CRAN (R 4.1.0)                       
##    utf8                   1.2.1       2021-03-12 [1] CRAN (R 4.1.0)                       
##    uuid                   0.1-4       2020-02-26 [1] CRAN (R 4.1.0)                       
##    V8                     3.4.2       2021-05-01 [1] CRAN (R 4.1.0)                       
##    vctrs                  0.3.8       2021-04-29 [1] CRAN (R 4.1.0)                       
##    viridis              * 0.6.1       2021-05-11 [1] CRAN (R 4.1.0)                       
##    viridisLite          * 0.4.0       2021-04-13 [1] CRAN (R 4.1.0)                       
##    visdat                 0.5.3       2019-02-15 [1] CRAN (R 4.1.0)                       
##    visNetwork           * 2.0.9       2019-12-06 [1] CRAN (R 4.1.0)                       
##    vistime              * 1.2.1       2021-04-10 [1] CRAN (R 4.1.0)                       
##    warp                   0.2.0       2020-10-21 [1] CRAN (R 4.1.0)                       
##    webshot              * 0.5.2       2019-11-22 [1] CRAN (R 4.1.0)                       
##    withr                  2.4.2       2021-04-18 [1] CRAN (R 4.1.0)                       
##    wk                     0.4.1       2021-03-16 [1] CRAN (R 4.1.0)                       
##    writexl              * 1.4.0       2021-04-20 [1] CRAN (R 4.1.0)                       
##    xfun                   0.24        2021-06-15 [1] CRAN (R 4.1.0)                       
##    XML                    3.99-0.6    2021-03-16 [1] CRAN (R 4.1.0)                       
##    xml2                   1.3.2       2020-04-23 [1] CRAN (R 4.1.0)                       
##    xtable               * 1.8-4       2019-04-21 [1] CRAN (R 4.1.0)                       
##    xts                  * 0.12.1      2020-09-09 [1] CRAN (R 4.1.0)                       
##    yaml                   2.2.1       2020-02-01 [1] CRAN (R 4.1.0)                       
##    yardstick            * 0.0.8       2021-03-28 [1] CRAN (R 4.1.0)                       
##    zip                    2.2.0       2021-05-31 [1] CRAN (R 4.1.0)                       
##    zoo                  * 1.8-9       2021-03-09 [1] CRAN (R 4.1.0)                       
## 
## [1] C:/Users/neale/OneDrive - Neale Batra/Documents/Analytics-LAPTOP-RS5P2IBO/R/Projects/R handbook/epiRhandbook_eng/renv/library/R-4.1/x86_64-w64-mingw32
## [2] C:/Users/neale/AppData/Local/Temp/Rtmpc1lSg5/renv-system-library
## 
##  D -- DLL MD5 mismatch, broken installation.