× Need help learning R? Enroll in Applied Epi's intro R course, try our free R tutorials, post in our Community Q&A forum, or ask about our R Help Desk service.

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
20 Nov 2022 Release of version 1.0.1

NEWS With version 1.0.1 the following changes have been implemented:

  • Update to R version 4.2
  • Data cleaning: switched {linelist} to {matchmaker}, removed unnecessary line from case_when() example
  • Dates: switched {linelist} guess_date() to {parsedate} parse_date()
  • Pivoting: slight update to pivot_wider() id_cols=
  • Survey analysis: switched plot_age_pyramid() to age_pyramid(), slight change to alluvial plot code
  • Heat plots: added ungroup() to agg_weeks chunk
  • Interactive plots: added ungroup() to chunk that makes agg_weeks so that expand() works as intended
  • Time series: added data.frame() around objects within all trending::fit() and predict() commands
  • Combinations analysis: Switch case_when() to ifelse() and added optional across() code for preparing the data
  • Transmission chains: Update to more recent version of {epicontacts}

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.3.0 (2023-04-21 ucrt)
##  os       Windows 11 x64 (build 22621)
##  system   x86_64, mingw32
##  ui       RStudio
##  language (EN)
##  collate  English_United States.utf8
##  ctype    English_United States.utf8
##  tz       Europe/Berlin
##  date     2023-07-18
##  rstudio  2023.06.1+524 Mountain Hydrangea (desktop)
##  pandoc   3.1.1 @ C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
## 
## ─ Packages ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
##  ! package              * version    date (UTC) lib source
##    abind                * 1.4-5      2016-07-21 [1] CRAN (R 4.3.0)
##    ada                    2.0-5      2016-05-13 [1] CRAN (R 4.3.0)
##    adagio                 0.8.5      2022-10-03 [1] CRAN (R 4.3.0)
##    ade4                   1.7-22     2023-02-06 [1] CRAN (R 4.3.0)
##    anytime                0.3.9      2020-08-27 [1] CRAN (R 4.3.0)
##    ape                  * 5.7-1      2023-03-13 [1] CRAN (R 4.3.0)
##    aplot                  0.1.10     2023-03-08 [1] CRAN (R 4.3.0)
##    apyramid             * 0.1.3      2023-02-14 [1] CRAN (R 4.3.0)
##    arm                    1.13-1     2022-08-28 [1] CRAN (R 4.3.0)
##    askpass                1.1        2019-01-13 [1] CRAN (R 4.3.0)
##    assertive.base         0.0-9      2021-02-08 [1] CRAN (R 4.3.0)
##    assertive.properties   0.0-5      2022-04-21 [1] CRAN (R 4.3.0)
##    assertive.types        0.0-3      2016-12-30 [1] CRAN (R 4.3.0)
##    assertthat             0.2.1      2019-03-21 [1] CRAN (R 4.3.0)
##    aweek                * 1.0.3      2022-10-06 [1] CRAN (R 4.3.0)
##    backports              1.4.1      2021-12-13 [1] CRAN (R 4.3.0)
##    base64enc              0.1-3      2015-07-28 [1] CRAN (R 4.3.0)
##    bayestestR           * 0.13.1     2023-04-07 [1] CRAN (R 4.3.0)
##    bit                  * 4.0.5      2022-11-15 [1] CRAN (R 4.3.0)
##    bit64                  4.0.5      2020-08-30 [1] CRAN (R 4.3.0)
##    blob                   1.2.4      2023-03-17 [1] CRAN (R 4.3.0)
##    bookdown               0.34       2023-05-09 [1] CRAN (R 4.3.1)
##    boot                 * 1.3-28.1   2022-11-22 [2] CRAN (R 4.3.0)
##    broom                * 1.0.4      2023-03-11 [1] CRAN (R 4.3.0)
##    broom.helpers          1.13.0     2023-03-28 [1] CRAN (R 4.3.0)
##    bslib                  0.5.0      2023-06-09 [1] CRAN (R 4.3.1)
##    cachem                 1.0.8      2023-05-01 [1] CRAN (R 4.3.0)
##    callr                  3.7.3      2022-11-02 [1] CRAN (R 4.3.0)
##    car                    3.1-2      2023-03-30 [1] CRAN (R 4.3.0)
##    carData                3.0-5      2022-01-06 [1] CRAN (R 4.3.0)
##    cellranger             1.1.0      2016-07-27 [1] CRAN (R 4.3.0)
##    ciTools                0.6.1      2020-10-25 [1] CRAN (R 4.3.0)
##    class                  7.3-21     2023-01-23 [2] CRAN (R 4.3.0)
##    classInt               0.4-9      2023-02-28 [1] CRAN (R 4.3.0)
##    cli                    3.6.1      2023-03-23 [1] CRAN (R 4.3.0)
##    clipr                  0.8.0      2022-02-22 [1] CRAN (R 4.3.0)
##    cmprsk                 2.2-11     2022-01-06 [1] CRAN (R 4.3.0)
##    coarseDataTools        0.6-6      2021-12-09 [1] CRAN (R 4.3.0)
##    coda                   0.19-4     2020-09-30 [1] CRAN (R 4.3.0)
##    codetools              0.2-19     2023-02-01 [2] CRAN (R 4.3.0)
##    colorspace             2.1-0      2023-01-23 [1] CRAN (R 4.3.0)
##    commonmark             1.9.0      2023-03-17 [1] CRAN (R 4.3.0)
##    correlation          * 0.8.4      2023-04-06 [1] CRAN (R 4.3.0)
##    corrr                * 0.4.4      2022-08-16 [1] CRAN (R 4.3.0)
##    cowplot              * 1.1.1      2020-12-30 [1] CRAN (R 4.3.0)
##    crayon                 1.5.2      2022-09-29 [1] CRAN (R 4.3.0)
##    crosstalk              1.2.0      2021-11-04 [1] CRAN (R 4.3.0)
##    crul                   1.4.0      2023-05-17 [1] CRAN (R 4.3.0)
##    curl                   5.0.0      2023-01-12 [1] CRAN (R 4.3.0)
##    data.table           * 1.14.8     2023-02-17 [1] CRAN (R 4.3.0)
##    datawizard           * 0.7.1      2023-04-03 [1] CRAN (R 4.3.0)
##    DBI                  * 1.1.3      2022-06-18 [1] CRAN (R 4.3.0)
##    deldir                 1.0-9      2023-05-17 [1] CRAN (R 4.3.0)
##    Deriv                  4.1.3      2021-02-24 [1] CRAN (R 4.3.0)
##    DiagrammeR           * 1.0.10     2023-05-18 [1] CRAN (R 4.3.0)
##    dichromat              2.0-0.1    2022-05-02 [1] CRAN (R 4.3.0)
##    digest                 0.6.31     2022-12-11 [1] CRAN (R 4.3.0)
##    distcrete            * 1.0.3      2017-11-23 [1] CRAN (R 4.3.0)
##    distributional         0.3.2      2023-03-22 [1] CRAN (R 4.3.0)
##    doBy                 * 4.6.16     2023-01-18 [1] CRAN (R 4.3.0)
##    doParallel             1.0.17     2022-02-07 [1] CRAN (R 4.3.0)
##    downlit                0.4.2      2022-07-05 [1] CRAN (R 4.3.0)
##    dplyr                * 1.1.2      2023-04-20 [1] CRAN (R 4.3.0)
##    dsr                  * 0.2.2      2019-08-23 [1] CRAN (R 4.3.0)
##    DT                   * 0.28       2023-05-18 [1] CRAN (R 4.3.0)
##    e1071                  1.7-13     2023-02-01 [1] CRAN (R 4.3.0)
##    easystats            * 0.6.0      2022-11-29 [1] CRAN (R 4.3.0)
##    ecmwfr               * 1.5.0      2023-01-19 [1] CRAN (R 4.3.0)
##    effectsize           * 0.8.3      2023-01-28 [1] CRAN (R 4.3.0)
##    ellipsis               0.3.2      2021-04-29 [1] CRAN (R 4.3.0)
##    Epi                  * 2.47.1     2023-04-25 [1] CRAN (R 4.3.0)
##    epicontacts          * 1.2.0      2023-05-21 [1] Github (reconhub/epicontacts@7df53e5)
##    epidict                0.0.0.9001 2023-05-21 [1] Github (R4EPI/epidict@9cf5a53)
##    EpiEstim             * 2.2-4      2021-01-07 [1] CRAN (R 4.3.0)
##    epikit               * 0.1.5      2023-02-15 [1] CRAN (R 4.3.0)
##    EpiNow2              * 1.3.5      2023-04-27 [1] CRAN (R 4.3.0)
##    epitabulate            0.0.0.9007 2023-05-21 [1] Github (R4EPI/epitabulate@56370b8)
##    epitrix              * 0.4.0      2023-01-13 [1] CRAN (R 4.3.0)
##    etm                    1.1.1      2020-09-08 [1] CRAN (R 4.3.0)
##    evaluate               0.21       2023-05-05 [1] CRAN (R 4.3.0)
##    evd                    2.3-6.1    2022-07-04 [1] CRAN (R 4.3.0)
##    fabletools           * 0.3.3      2023-04-04 [1] CRAN (R 4.3.0)
##    FactoClass             1.2.7      2018-10-01 [1] CRAN (R 4.3.0)
##    fansi                  1.0.4      2023-01-22 [1] CRAN (R 4.3.0)
##    farver                 2.1.1      2022-07-06 [1] CRAN (R 4.3.0)
##    fastLink             * 0.6.0      2020-04-29 [1] CRAN (R 4.3.0)
##    fastmap                1.1.1      2023-02-24 [1] CRAN (R 4.3.0)
##    feasts               * 0.3.1      2023-03-22 [1] CRAN (R 4.3.0)
##    ff                   * 4.0.9      2023-01-25 [1] CRAN (R 4.3.0)
##    fitdistrplus           1.1-11     2023-04-25 [1] CRAN (R 4.3.0)
##    flexdashboard        * 0.6.1      2023-01-23 [1] CRAN (R 4.3.0)
##    flextable            * 0.9.1      2023-04-02 [1] CRAN (R 4.3.0)
##    fontBitstreamVera      0.1.1      2017-02-01 [1] CRAN (R 4.3.0)
##    fontLiberation         0.1.0      2016-10-15 [1] CRAN (R 4.3.0)
##    fontquiver             0.2.1      2017-02-01 [1] CRAN (R 4.3.0)
##    forcats              * 1.0.0      2023-01-29 [1] CRAN (R 4.3.0)
##    foreach                1.5.2      2022-02-02 [1] CRAN (R 4.3.0)
##    forecast             * 8.21       2023-02-27 [1] CRAN (R 4.3.0)
##    foreign                0.8-84     2022-12-06 [2] CRAN (R 4.3.0)
##    formatR                1.14       2023-01-17 [1] CRAN (R 4.3.0)
##    formattable          * 0.2.1      2021-01-07 [1] CRAN (R 4.3.0)
##    Formula              * 1.2-5      2023-02-24 [1] CRAN (R 4.3.0)
##    fracdiff               1.5-2      2022-10-31 [1] CRAN (R 4.3.0)
##    frailtypack          * 3.5.0      2021-12-20 [1] CRAN (R 4.3.0)
##    fs                   * 1.6.2      2023-04-25 [1] CRAN (R 4.3.0)
##    futile.logger          1.4.3      2016-07-10 [1] CRAN (R 4.3.0)
##    futile.options         1.0.1      2018-04-20 [1] CRAN (R 4.3.0)
##    future                 1.32.0     2023-03-07 [1] CRAN (R 4.3.0)
##    future.apply           1.11.0     2023-05-21 [1] CRAN (R 4.3.0)
##    gdtools                0.3.3      2023-03-27 [1] CRAN (R 4.3.0)
##    generics               0.1.3      2022-07-05 [1] CRAN (R 4.3.0)
##    gfonts                 0.2.0      2023-01-08 [1] CRAN (R 4.3.0)
##    ggExtra              * 0.10.0     2022-03-23 [1] CRAN (R 4.3.0)
##    ggforce              * 0.4.1      2022-10-04 [1] CRAN (R 4.3.0)
##    ggfun                  0.0.9      2022-11-21 [1] CRAN (R 4.3.0)
##    gghighlight          * 0.4.0      2022-10-16 [1] CRAN (R 4.3.0)
##    ggnewscale           * 0.4.8      2022-10-06 [1] CRAN (R 4.3.0)
##    ggplot2              * 3.4.2      2023-04-03 [1] CRAN (R 4.3.0)
##    ggplotify              0.1.0      2021-09-02 [1] CRAN (R 4.3.0)
##    ggpubr               * 0.6.0      2023-02-10 [1] CRAN (R 4.3.0)
##    ggrepel              * 0.9.3      2023-02-03 [1] CRAN (R 4.3.0)
##    ggsignif               0.6.4      2022-10-13 [1] CRAN (R 4.3.0)
##    ggtext                 0.1.2      2022-09-16 [1] CRAN (R 4.3.0)
##    ggtree               * 3.8.0      2023-04-25 [1] Bioconductor
##    ggupset              * 0.3.0      2020-05-05 [1] CRAN (R 4.3.0)
##    globals                0.16.2     2022-11-21 [1] CRAN (R 4.3.0)
##    glue                   1.6.2      2022-02-24 [1] CRAN (R 4.3.0)
##    grates               * 1.0.1      2023-04-02 [1] CRAN (R 4.3.0)
##    gridExtra              2.3        2017-09-09 [1] CRAN (R 4.3.0)
##    gridGraphics           0.5-1      2020-12-13 [1] CRAN (R 4.3.0)
##    gridtext               0.1.5      2022-09-16 [1] CRAN (R 4.3.0)
##    gt                     0.9.0      2023-03-31 [1] CRAN (R 4.3.0)
##    gtable                 0.3.3      2023-03-21 [1] CRAN (R 4.3.0)
##    gtools                 3.9.4      2022-11-27 [1] CRAN (R 4.3.0)
##    gtsummary            * 1.7.1      2023-04-27 [1] CRAN (R 4.3.0)
##    haven                  2.5.2      2023-02-28 [1] CRAN (R 4.3.0)
##    here                 * 1.0.1      2020-12-13 [1] CRAN (R 4.3.0)
##    highcharter          * 0.9.4      2022-01-03 [1] CRAN (R 4.3.0)
##    highr                  0.10       2022-12-22 [1] CRAN (R 4.3.0)
##    hms                    1.1.3      2023-03-21 [1] CRAN (R 4.3.0)
##    htmltools              0.5.5      2023-03-23 [1] CRAN (R 4.3.0)
##    htmlwidgets            1.6.2      2023-03-17 [1] CRAN (R 4.3.0)
##    httpcode               0.3.0      2020-04-10 [1] CRAN (R 4.3.0)
##    httpuv                 1.6.11     2023-05-11 [1] CRAN (R 4.3.0)
##    httr                   1.4.6      2023-05-08 [1] CRAN (R 4.3.0)
##    i2extras             * 0.2.1      2023-03-17 [1] CRAN (R 4.3.0)
##    igraph                 1.4.2      2023-04-07 [1] CRAN (R 4.3.0)
##    imputeTS             * 3.3        2022-09-09 [1] CRAN (R 4.3.0)
##    incidence              1.7.3      2020-11-04 [1] CRAN (R 4.3.0)
##    incidence2           * 2.0.0      2023-03-17 [1] CRAN (R 4.3.0)
##    inline                 0.3.19     2021-05-31 [1] CRAN (R 4.3.0)
##    insight              * 0.19.1     2023-03-18 [1] CRAN (R 4.3.0)
##    ipred                  0.9-14     2023-03-09 [1] CRAN (R 4.3.0)
##    isoband                0.2.7      2022-12-20 [1] CRAN (R 4.3.0)
##    iterators              1.0.14     2022-02-05 [1] CRAN (R 4.3.0)
##    janitor              * 2.2.0      2023-02-02 [1] CRAN (R 4.3.0)
##    jpeg                   0.1-10     2022-11-29 [1] CRAN (R 4.3.0)
##    jquerylib              0.1.4      2021-04-26 [1] CRAN (R 4.3.0)
##    jsonlite               1.8.4      2022-12-06 [1] CRAN (R 4.3.0)
##    kableExtra           * 1.3.4      2021-02-20 [1] CRAN (R 4.3.0)
##    KernSmooth             2.23-20    2021-05-03 [2] CRAN (R 4.3.0)
##    km.ci                  0.5-6      2022-04-06 [1] CRAN (R 4.3.0)
##    KMsurv                 0.1-5      2012-12-03 [1] CRAN (R 4.3.0)
##    knitr                  1.42       2023-01-25 [1] CRAN (R 4.3.0)
##    labeling               0.4.2      2020-10-20 [1] CRAN (R 4.3.0)
##    labelled               2.11.0     2023-04-11 [1] CRAN (R 4.3.0)
##    lambda.r               1.2.4      2019-09-18 [1] CRAN (R 4.3.0)
##    later                  1.3.1      2023-05-02 [1] CRAN (R 4.3.0)
##    lattice                0.21-8     2023-04-05 [2] CRAN (R 4.3.0)
##    lava                   1.7.2.1    2023-02-27 [1] CRAN (R 4.3.0)
##    lazyeval               0.2.2      2019-03-15 [1] CRAN (R 4.3.0)
##    leafem                 0.2.0      2022-04-16 [1] CRAN (R 4.3.0)
##    leaflet                2.1.2      2023-03-10 [1] CRAN (R 4.3.0)
##    leaflet.providers      1.9.0      2019-11-09 [1] CRAN (R 4.3.0)
##    leafsync               0.1.0      2019-03-05 [1] CRAN (R 4.3.0)
##    lifecycle              1.0.3      2022-10-07 [1] CRAN (R 4.3.0)
##    listenv                0.9.0      2022-12-16 [1] CRAN (R 4.3.0)
##    lme4                   1.1-33     2023-04-25 [1] CRAN (R 4.3.0)
##    lmtest               * 0.9-40     2022-03-21 [1] CRAN (R 4.3.0)
##    loo                    2.6.0      2023-03-31 [1] CRAN (R 4.3.0)
##    lpSolve                5.6.18     2023-02-01 [1] CRAN (R 4.3.0)
##    lubridate            * 1.9.2      2023-02-10 [1] CRAN (R 4.3.0)
##    lwgeom                 0.2-11     2023-01-14 [1] CRAN (R 4.3.0)
##    magrittr             * 2.0.3      2022-03-30 [1] CRAN (R 4.3.0)
##    markdown               1.7        2023-05-16 [1] CRAN (R 4.3.0)
##    MASS                 * 7.3-58.4   2023-03-07 [2] CRAN (R 4.3.0)
##    matchmaker           * 0.1.1      2020-02-21 [1] CRAN (R 4.3.0)
##    Matrix               * 1.5-4      2023-04-04 [2] CRAN (R 4.3.0)
##    MatrixModels           0.5-1      2022-09-11 [1] CRAN (R 4.3.0)
##    matrixStats            0.63.0     2022-11-18 [1] CRAN (R 4.3.0)
##    mcmc                   0.9-7      2020-03-21 [1] CRAN (R 4.3.0)
##    MCMCpack               1.6-3      2022-04-13 [1] CRAN (R 4.3.0)
##    memoise                2.0.1      2021-11-26 [1] CRAN (R 4.3.0)
##    mgcv                   1.8-42     2023-03-02 [2] CRAN (R 4.3.0)
##    mice                 * 3.15.0     2022-11-19 [1] CRAN (R 4.3.0)
##    microbenchmark         1.4.10     2023-04-28 [1] CRAN (R 4.3.0)
##    mime                   0.12       2021-09-28 [1] CRAN (R 4.3.0)
##    miniUI                 0.1.1.1    2018-05-18 [1] CRAN (R 4.3.0)
##    minqa                  1.2.5      2022-10-19 [1] CRAN (R 4.3.0)
##    mitools                2.4        2019-04-26 [1] CRAN (R 4.3.0)
##    modelbased           * 0.8.6      2023-01-13 [1] CRAN (R 4.3.0)
##    munsell                0.5.0      2018-06-12 [1] CRAN (R 4.3.0)
##    naniar               * 1.0.0      2023-02-02 [1] CRAN (R 4.3.0)
##    networkD3            * 0.4        2017-03-18 [1] CRAN (R 4.3.0)
##    nlme                   3.1-162    2023-01-31 [2] CRAN (R 4.3.0)
##    nloptr                 2.0.3      2022-05-26 [1] CRAN (R 4.3.0)
##    nnet                   7.3-18     2022-09-28 [2] CRAN (R 4.3.0)
##    numDeriv               2016.8-1.1 2019-06-06 [1] CRAN (R 4.3.0)
##    officer              * 0.6.2      2023-03-28 [1] CRAN (R 4.3.0)
##    openssl                2.0.6      2023-03-09 [1] CRAN (R 4.3.0)
##    OpenStreetMap        * 0.3.4      2019-05-31 [1] CRAN (R 4.3.0)
##    openxlsx               4.2.5.2    2023-02-06 [1] CRAN (R 4.3.0)
##    pacman                 0.5.1      2019-03-11 [1] CRAN (R 4.3.0)
##    parallelly             1.35.0     2023-03-23 [1] CRAN (R 4.3.0)
##    parameters           * 0.21.0     2023-04-19 [1] CRAN (R 4.3.0)
##    parsedate            * 1.3.1      2022-10-27 [1] CRAN (R 4.3.0)
##    patchwork            * 1.1.2      2022-08-19 [1] CRAN (R 4.3.0)
##    performance          * 0.10.3     2023-04-07 [1] CRAN (R 4.3.0)
##    PerformanceAnalytics * 2.0.4      2020-02-06 [1] CRAN (R 4.3.0)
##    PHEindicatormethods  * 2.0.1      2023-05-05 [1] CRAN (R 4.3.0)
##    pillar                 1.9.0      2023-03-22 [1] CRAN (R 4.3.0)
##    pkgbuild               1.4.0      2022-11-27 [1] CRAN (R 4.3.0)
##    pkgconfig              2.0.3      2019-09-22 [1] CRAN (R 4.3.0)
##    plotly               * 4.10.1     2022-11-07 [1] CRAN (R 4.3.0)
##    plotrix                3.8-2      2021-09-08 [1] CRAN (R 4.3.0)
##    plyr                   1.8.8      2022-11-11 [1] CRAN (R 4.3.0)
##    png                    0.1-8      2022-11-29 [1] CRAN (R 4.3.0)
##    polyclip               1.10-4     2022-10-20 [1] CRAN (R 4.3.0)
##    polyCub                0.8.1      2022-11-28 [1] CRAN (R 4.3.0)
##    prettyunits            1.1.1      2020-01-24 [1] CRAN (R 4.3.0)
##    processx               3.8.1      2023-04-18 [1] CRAN (R 4.3.0)
##    prodlim                2023.03.31 2023-04-02 [1] CRAN (R 4.3.0)
##    progressr              0.13.0     2023-01-10 [1] CRAN (R 4.3.0)
##    projections          * 0.6.0      2023-03-23 [1] CRAN (R 4.3.0)
##    promises               1.2.0.1    2021-02-11 [1] CRAN (R 4.3.0)
##    proxy                  0.4-27     2022-06-09 [1] CRAN (R 4.3.0)
##    ps                     1.7.5      2023-04-18 [1] CRAN (R 4.3.0)
##    purrr                * 1.0.1      2023-01-10 [1] CRAN (R 4.3.0)
##    quadprog               1.5-8      2019-11-20 [1] CRAN (R 4.3.0)
##    Quandl                 2.11.0     2021-08-11 [1] CRAN (R 4.3.0)
##    quantmod             * 0.4.22     2023-04-07 [1] CRAN (R 4.3.0)
##    quantreg               5.95       2023-04-08 [1] CRAN (R 4.3.0)
##    R.methodsS3            1.8.2      2022-06-13 [1] CRAN (R 4.3.0)
##    R.oo                   1.25.0     2022-06-12 [1] CRAN (R 4.3.0)
##    R.utils                2.12.2     2022-11-11 [1] CRAN (R 4.3.0)
##    R6                     2.5.1      2021-08-19 [1] CRAN (R 4.3.0)
##    ragg                   1.2.5      2023-01-12 [1] CRAN (R 4.3.0)
##    raster                 3.6-20     2023-03-06 [1] CRAN (R 4.3.0)
##    RColorBrewer         * 1.1-3      2022-04-03 [1] CRAN (R 4.3.0)
##    Rcpp                 * 1.0.10     2023-01-22 [1] CRAN (R 4.3.0)
##  D RcppParallel           5.1.7      2023-02-27 [1] CRAN (R 4.3.0)
##    readr                * 2.1.4      2023-02-10 [1] CRAN (R 4.3.0)
##    readxl               * 1.4.2      2023-02-09 [1] CRAN (R 4.3.0)
##    RecordLinkage        * 0.4-12.4   2022-11-08 [1] CRAN (R 4.3.0)
##    remotes                2.4.2      2021-11-30 [1] CRAN (R 4.3.0)
##    report               * 0.5.7      2023-03-22 [1] CRAN (R 4.3.0)
##    repr                   1.1.6      2023-01-26 [1] CRAN (R 4.3.0)
##    reprex                 2.0.2      2022-08-17 [1] CRAN (R 4.3.0)
##    reshape2               1.4.4      2020-04-09 [1] CRAN (R 4.3.0)
##    rgdal                  1.6-6      2023-04-18 [1] CRAN (R 4.3.0)
##    rio                  * 0.5.29     2021-11-22 [1] CRAN (R 4.3.0)
##  D rJava                  1.0-6      2021-12-10 [1] CRAN (R 4.3.0)
##    rlang                  1.1.1      2023-04-28 [1] CRAN (R 4.3.0)
##    rlist                  0.4.6.2    2021-09-03 [1] CRAN (R 4.3.0)
##    rmarkdown              2.21       2023-03-26 [1] CRAN (R 4.3.0)
##    rootSolve              1.8.2.3    2021-09-29 [1] CRAN (R 4.3.0)
##    rpart                  4.1.19     2022-10-21 [2] CRAN (R 4.3.0)
##    rprojroot              2.0.3      2022-04-02 [1] CRAN (R 4.3.0)
##    RSQLite              * 2.3.1      2023-04-03 [1] CRAN (R 4.3.0)
##    rstan                  2.21.8     2023-01-17 [1] CRAN (R 4.3.0)
##    rstantools             2.3.1      2023-03-30 [1] CRAN (R 4.3.0)
##    rstatix              * 0.7.2      2023-02-01 [1] CRAN (R 4.3.0)
##    rstudioapi             0.15.0     2023-07-07 [1] CRAN (R 4.3.1)
##    runner                 0.4.3      2023-03-21 [1] CRAN (R 4.3.0)
##    rvest                  1.0.3      2022-08-19 [1] CRAN (R 4.3.0)
##    s2                     1.1.4      2023-05-17 [1] CRAN (R 4.3.0)
##    sass                   0.4.6      2023-05-03 [1] CRAN (R 4.3.0)
##    scales               * 1.2.1      2022-08-20 [1] CRAN (R 4.3.0)
##    scatterplot3d          0.3-44     2023-05-05 [1] CRAN (R 4.3.0)
##    see                  * 0.7.5      2023-03-23 [1] CRAN (R 4.3.0)
##    SemiCompRisks        * 3.4        2021-02-03 [1] CRAN (R 4.3.0)
##    sessioninfo            1.2.2      2021-12-06 [1] CRAN (R 4.3.0)
##    sf                   * 1.0-12     2023-03-19 [1] CRAN (R 4.3.0)
##    shiny                * 1.7.4      2022-12-15 [1] CRAN (R 4.3.0)
##    shinyWidgets           0.7.6      2023-01-08 [1] CRAN (R 4.3.0)
##    sitrep               * 0.2.3      2023-05-21 [1] Github (r4epi/sitrep@b96906b)
##    skimr                * 2.1.5      2022-12-23 [1] CRAN (R 4.3.0)
##    slider               * 0.3.0      2022-11-16 [1] CRAN (R 4.3.0)
##    snakecase              0.11.0     2019-05-25 [1] CRAN (R 4.3.0)
##    sp                   * 1.6-0      2023-01-19 [1] CRAN (R 4.3.0)
##    SparseM                1.81       2021-02-18 [1] CRAN (R 4.3.0)
##    spatstat.data          3.0-1      2023-03-12 [1] CRAN (R 4.3.0)
##    spatstat.geom          3.2-1      2023-05-09 [1] CRAN (R 4.3.0)
##    spatstat.utils         3.0-3      2023-05-09 [1] CRAN (R 4.3.0)
##    spData               * 2.2.2      2023-03-01 [1] CRAN (R 4.3.0)
##    spdep                * 1.2-8      2023-02-28 [1] CRAN (R 4.3.0)
##    srvyr                * 1.2.0      2023-02-21 [1] CRAN (R 4.3.0)
##    StanHeaders            2.26.25    2023-05-17 [1] CRAN (R 4.3.0)
##    stars                * 0.6-1      2023-04-06 [1] CRAN (R 4.3.0)
##    statmod                1.5.0      2023-01-06 [1] CRAN (R 4.3.0)
##    stinepack              1.4        2018-07-30 [1] CRAN (R 4.3.0)
##    stringdist           * 0.9.10     2022-11-07 [1] CRAN (R 4.3.0)
##    stringi                1.7.12     2023-01-11 [1] CRAN (R 4.3.0)
##    stringr              * 1.5.0      2022-12-02 [1] CRAN (R 4.3.0)
##    survC1               * 1.0-3      2021-02-10 [1] CRAN (R 4.3.0)
##    surveillance         * 1.21.1     2023-05-19 [1] CRAN (R 4.3.0)
##    survey               * 4.2-1      2023-05-03 [1] CRAN (R 4.3.0)
##    survival             * 3.5-5      2023-03-12 [2] CRAN (R 4.3.0)
##    survminer            * 0.4.9      2021-03-09 [1] CRAN (R 4.3.0)
##    survMisc               0.5.6      2022-04-07 [1] CRAN (R 4.3.0)
##    svglite                2.1.1      2023-01-10 [1] CRAN (R 4.3.0)
##    systemfonts            1.0.4      2022-02-11 [1] CRAN (R 4.3.0)
##    terra                  1.7-29     2023-04-22 [1] CRAN (R 4.3.0)
##    textshaping            0.3.6      2021-10-13 [1] CRAN (R 4.3.0)
##    tibble               * 3.2.1      2023-03-20 [1] CRAN (R 4.3.0)
##    tidyquant            * 1.0.7      2023-03-31 [1] CRAN (R 4.3.0)
##    tidyr                * 1.3.0      2023-01-24 [1] CRAN (R 4.3.0)
##    tidyselect             1.2.0      2022-10-10 [1] CRAN (R 4.3.0)
##    tidytree               0.4.2      2022-12-18 [1] CRAN (R 4.3.0)
##    tidyverse            * 2.0.0      2023-02-22 [1] CRAN (R 4.3.0)
##    timechange             0.2.0      2023-01-11 [1] CRAN (R 4.3.0)
##    timeDate               4022.108   2023-01-07 [1] CRAN (R 4.3.0)
##    tinytex                0.45       2023-04-18 [1] CRAN (R 4.3.0)
##    tmap                 * 3.3-3      2022-03-02 [1] CRAN (R 4.3.0)
##    tmaptools            * 3.1-1      2021-01-19 [1] CRAN (R 4.3.0)
##    treeio               * 1.24.0     2023-04-25 [1] Bioconductor
##    trending             * 0.1.0      2023-04-03 [1] CRAN (R 4.3.0)
##    truncnorm              1.0-9      2023-03-20 [1] CRAN (R 4.3.0)
##    tseries                0.10-54    2023-05-02 [1] CRAN (R 4.3.0)
##    tsibble              * 1.1.3      2022-10-09 [1] CRAN (R 4.3.0)
##    TTR                  * 0.24.3     2021-12-12 [1] CRAN (R 4.3.0)
##    tweenr                 2.0.2      2022-09-06 [1] CRAN (R 4.3.0)
##    tzdb                   0.4.0      2023-05-12 [1] CRAN (R 4.3.0)
##    units                * 0.8-2      2023-04-27 [1] CRAN (R 4.3.0)
##    UpSetR               * 1.4.0      2019-05-22 [1] CRAN (R 4.3.0)
##    urca                   1.3-3      2022-08-29 [1] CRAN (R 4.3.0)
##    utf8                   1.2.3      2023-01-31 [1] CRAN (R 4.3.0)
##    uuid                   1.1-0      2022-04-19 [1] CRAN (R 4.3.0)
##    vctrs                  0.6.2      2023-04-19 [1] CRAN (R 4.3.0)
##    viridis                0.6.3      2023-05-03 [1] CRAN (R 4.3.0)
##    viridisLite            0.4.2      2023-05-02 [1] CRAN (R 4.3.0)
##    visdat                 0.6.0      2023-02-02 [1] CRAN (R 4.3.0)
##    visNetwork           * 2.1.2      2022-09-29 [1] CRAN (R 4.3.0)
##    vistime              * 1.2.3      2022-10-16 [1] CRAN (R 4.3.0)
##    warp                   0.2.0      2020-10-21 [1] CRAN (R 4.3.0)
##    webshot              * 0.5.4      2022-09-26 [1] CRAN (R 4.3.0)
##    withr                  2.5.0      2022-03-03 [1] CRAN (R 4.3.0)
##    wk                     0.7.3      2023-05-06 [1] CRAN (R 4.3.0)
##    writexl              * 1.4.2      2023-01-06 [1] CRAN (R 4.3.0)
##    xfun                   0.39       2023-04-20 [1] CRAN (R 4.3.0)
##    XML                    3.99-0.14  2023-03-19 [1] CRAN (R 4.3.0)
##    xml2                   1.3.4      2023-04-27 [1] CRAN (R 4.3.0)
##    xtable               * 1.8-4      2019-04-21 [1] CRAN (R 4.3.0)
##    xts                  * 0.13.1     2023-04-16 [1] CRAN (R 4.3.0)
##    yaml                   2.3.7      2023-01-23 [1] CRAN (R 4.3.0)
##    yardstick            * 1.2.0      2023-04-21 [1] CRAN (R 4.3.0)
##    yulab.utils            0.0.6      2022-12-20 [1] CRAN (R 4.3.0)
##    zip                    2.3.0      2023-04-17 [1] CRAN (R 4.3.0)
##    zoo                  * 1.8-12     2023-04-13 [1] CRAN (R 4.3.0)
## 
##  [1] C:/Users/neale/AppData/Local/R/win-library/4.3
##  [2] C:/Program Files/R/R-4.3.0/library
## 
##  D ── DLL MD5 mismatch, broken installation.
## 
## ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────