add_collection_date: Add Specimen Collection Date to a Report Date Tibble

View source: R/report_date.R

add_collection_dateR Documentation

Add Specimen Collection Date to a Report Date Tibble

Description

add_collection_date() reads the specimen collection date column from an NBS data file and adds it to the input data (typically the result of coalesce_report_date()).

Usage

add_collection_date(
  .data,
  .from_col = "specimen_coll_dt",
  .id_col = "inv_local_id",
  ...,
  date = Sys.Date(),
  from_file = path_create("V:/EPI DATA ANALYTICS TEAM/COVID SANDBOX REDCAP Data/",
    "Sandbox data pull Final/")
)

Arguments

.data

A tibble returned from coalesce_report_date()

.from_col

A string indicating the variable in .from_file to use as specimen collection date

.id_col

A string indicating the variable in .data and from_file to use as an ID variable

...

<tidy-select> Additional variables to add

date

The date of the NBS file to use for collection dates

from_file

A file path to the NBS data with the desired specimen collection dates; if only a directory is provided, the NBS file corresponding to date will be used


jesse-smith/coviData documentation built on Jan. 14, 2023, 11:08 a.m.