Calls reader with ..., then records the call as a data_read ACTION
entry. Unlike namespace patching, rl_read() wraps the call explicitly —
no package internals are modified, and behaviour is identical whether
called from a single script or concurrently across multiple Shiny
sessions.
Arguments
- log
A
regulogobject fromregulog_init()orregulog_shiny_init().- reader
A function that reads data, e.g.
haven::read_sas,readr::read_csv,data.table::fread,utils::read.csv.- ...
Arguments passed to
reader.
Details
The path/file recorded in the audit entry is resolved as follows:
A named argument in
...calledfile,path, ordata_file.The first unnamed argument in
..., if any."unknown", if neither is found.
This avoids the failure mode of positional-only extraction, where a
reordered named call (e.g. read_csv(col_types = "ccd", file = "x.csv"))
would otherwise record the wrong value.
Examples
log <- regulog_init(app = "pipeline", version = "1.0", user = "jsmith")
if (FALSE) { # \dontrun{
adsl <- rl_read(log, haven::read_sas, "data/adsl.sas7bdat")
adae <- rl_read(log, readr::read_csv, file = "data/adae.csv")
} # }
