Skip to contents

Reads the RDS file, checks it is a cohort file, and re-validates the cohort before returning it.

Usage

cohort_read(path)

Arguments

path

Path to a file written by cohort_save().

Value

The Cohort object.

See also

Examples

data(example_cohort)
path <- tempfile(fileext = ".rds")
cohort_save(example_cohort, path)

restored <- cohort_read(path)
identical(subjects(restored), subjects(example_cohort))
#> [1] TRUE
unlink(path)