Wraps a Cohort with a small format marker and the package version, and
writes it with saveRDS(). Read it back with cohort_read().
Arguments
- cohort
A Cohort object.
- path
Output file path, conventionally ending in
.rds.
Examples
data(example_cohort)
path <- tempfile(fileext = ".rds")
cohort_save(example_cohort, path)
cohort_read(path)
#>
#> ── Cohort: Cross-species genomics comparison
#> • 4 subjects (2 mouse, 2 rat)
#> • 12 samples (8 wes, 4 scrna)
#> ℹ Extra sample columns: fastq_1, fastq_2
unlink(path)