Skip to contents

Reads a bundle written by write_design() (a folder or .zip file), checks each table against its checksum and restores its column types, then runs the recorded steps with the installed version of tidycreel.

Usage

read_design(path, ...)

Arguments

path

A bundle folder or .zip file.

...

Tables for steps the bundle does not carry (written with include_data = FALSE), named by their argument: counts = , interviews = , and catch = , lengths = , ages = for the tables given to add_catch(), add_lengths() and add_ages().

Value

A creel_design() object.

Details

A manifest written by hand works too: list the steps and their tables, as write_design() does. Without recorded column types, the date column of the calendar is read as a date and other columns take the types utils::read.csv() guesses; tables without a checksum are reported as not verified.

See also

Examples

data(example_calendar)
data(example_counts)
d <- creel_design(example_calendar, date = date, strata = day_type)
d <- add_counts(d, example_counts, count_col = effort_hours)
path <- file.path(tempdir(), "example-design")
write_design(d, path, overwrite = TRUE)
d2 <- read_design(path)
unlink(path, recursive = TRUE)