The inverse of read_workbook(): writes an inputs list (as
returned by read_inputs()) back to a single .xlsx workbook, one sheet per
element (observations, locations, configuration, and target when
present). Uses the 'openxlsx2' package.
Arguments
- inputs
a list with
obsandlocs(and optionallytarget) data frames, e.g. the result ofread_inputs().- path
character; destination
.xlsxpath.
Examples
inputs <- list(
obs = data.frame(obs_id = 1, loc_id = "A", cohort = 5, age = 5,
dose = 2, positive = 3, sample_n = 10),
locs = data.frame(loc_id = "A", parent_id = NA)
)
out <- file.path(tempdir(), "inputs.xlsx")
write_workbook(inputs, out)