read_sitrep: Read COVID Sitrep file

Description Usage Arguments Value

View source: R/read-sitrep.R

Description

Used to read in sitrep files. Avoids DRY violations throughout; hopefully with performance.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
read_sitrep(
  view,
  prev = FALSE,
  latest = FALSE,
  data_source = NULL,
  excl_diag_today = TRUE,
  use_fst = getOption("dhhs.use_fst", FALSE),
  columns = NULL,
  decode = TRUE,
  verbose = getOption("verbose", FALSE),
  reset_cache = getOption("dhhs.reset_cache", FALSE),
  exact = getOption("dhhs.sitrep_file_exact", FALSE)
)

Arguments

view, prev, latest

As in 'sitrep_file()' above.

data_source

Which data to use? One of "today", "previous", "latest", or "hour".

By default, the values of previous,latest are used. If data_source is not NULL it takes priority.

excl_diag_today

(TRUE or FALSE, default: TRUE) Should rows where DiagnosisDate >= today() be dropped? Has no effect if the requested file has no such column.

use_fst

Should .fst files be used if available. If TRUE, but the corresponding file does not exist, it will be created and read in on future reads.

columns

Only useful when reading .fst files. A character vector of column names to read in, dropping others. If NULL, the default, all columns are read.

decode

If FALSE, fst files will be read without being decoded from integer to character. Set to FALSE if you will decode the items at a later stage and the performance penalty is too large.

verbose

Be chatty and report the output from fread(..., verbose = TRUE)?

reset_cache

If TRUE, saved fst files will be deleted. Useful if the original files have been updated, or if the fst file had problems.

exact

FALSE | TRUE If TRUE, then view must match exactly, (up to file extensions).

Value

A data.table sourced from the requested sitrep file.


HughParsonage/dhhs documentation built on Dec. 17, 2021, 11:22 p.m.