process-nbs: Run the Cases Workflow for Daily Report

process-nbsR Documentation

Run the Cases Workflow for Daily Report

Description

The process_* functions transform NBS data in preparation for analysis.

process_inv() transforms investigation data.

process_pcr() transforms PCR data.

pos() and neg() extract positive or negative data from the result.

Usage

process_inv(
  data = read_inv(),
  date = attr(data, "date"),
  distinct = TRUE,
  replace = FALSE,
  quiet = FALSE
)

process_pcr(
  data = read_pcr(),
  inv = process_inv(read_inv(date = date)),
  date = attr(data, "date"),
  quiet = FALSE
)

pos(data)

neg(data)

process_positive_people(data = read_inv(date), date = NULL, replace = FALSE)

process_negative_people(data = read_inv(date), date = NULL, replace = FALSE)

process_positive_tests(data = read_pcr(date), date = NULL)

process_negative_tests(data = read_pcr(date), date = NULL)

Arguments

data

A tibble. Input data- either investigations for process_inv() or PCR tests for process_pcr()

date

The download date of the data. If the data has a date attribute, this is used; otherwise, the date must be supplied. See Details above.

replace

Should the filtering results be recalculated and replace the existing results (if any)?

quiet

Should intermediate step summaries be output as messages?

inv

A tibble. Input investigation data for process_pcr(), as returned by process_inv().

Details

process_inv() is special in that it saves records identified as positive and negative to the V: drive as an fst file. This allows significant speedup on subsequent runs, since the only necessary operations are mutating of key variables prior to filtering.

process_pcr() joins PCR data to the results of process_inv(). These results can be supplied by the inv argument; by default, they are calculated on-the-fly.

Both functions need the download date of their data. read_inv() and read_pcr() supply this as a date attribute; if this exists in the input data, it is used (with a warning if it conflicts with the date argument). If it does not exist, the date argument defaults to the most recent download date; in general, the date should either be supplied by an attribute (as above) or explicitly passed to the date argument.

process_positive_people(), process_negative_people(), process_positive_tests(), and process_negative_tests() are deprecated in favor of pos(process_inv()), neg(process_inv()), pos(process_pcr()), and neg(process_pcr())

Value

A nested 2x2 tibble with logical column positive and list_of<tbl_df> column data; the latter contains the transformed positive and negative data


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