Exports a creel_schedule object to disk. The default format is CSV using
base R (no extra dependencies). The "xlsx" format requires the
writexl package; an informative error is raised if it is not
installed.
Usage
write_schedule(schedule, path, format = c("csv", "xlsx"))Arguments
- schedule
A
creel_scheduleobject (or plain data frame) to export.- path
File path for the output file.
- format
One of
"csv"(default) or"xlsx". When"csv", the file is written withutils::write.csv()(no row names). When"xlsx",writexl::write_xlsx()is used behind anrlang::check_installed()guard.
Examples
sched <- generate_schedule(
"2024-06-01", "2024-08-31",
n_periods = 2,
sampling_rate = c(weekday = 0.3, weekend = 0.6),
seed = 42
)
tmp <- tempfile(fileext = ".csv")
write_schedule(sched, tmp)
