Skip to contents

Create a data source object for cfa-dataops NHSN data

Usage

cfa_dataops_source(
  target = c("covid", "flu", "rsv"),
  prelim = TRUE,
  dataset_namespace = NULL,
  stage = "load",
  command = "dataops_save",
  cache_dir = NULL,
  force = FALSE,
  run_dataops_save = NULL
)

Arguments

target

Character, disease target: "covid", "flu", or "rsv".

prelim

Logical. If TRUE, use the preliminary NHSN HRD dataset.

dataset_namespace

Character. Optional cfa-dataops dataset namespace. Defaults to the cfa-stf NHSN HRD namespace implied by prelim.

stage

Character. cfa-dataops dataset stage to download.

command

Character. Name or path of the dataops_save command.

cache_dir

Character. Optional directory used for downloaded cfa-dataops versions. A temporary directory is used when NULL.

force

Logical. Passed through to dataops_save --force.

run_dataops_save

Function used to invoke the dataops_save CLI. The default implementation shells out via system2(). It is called with two arguments: command (the value of the command constructor argument) and args (a character vector built from the other constructor arguments such as dataset_namespace, stage, and force). Override to swap in an alternative runner — for example, a different process-spawning mechanism, or a stub during testing.

Value

A source object of class "cfa_dataops_source".