Skip to contents

Wraps a Cohort with a small format marker and the package version, and writes it with saveRDS(). Read it back with cohort_read().

Usage

cohort_save(cohort, path)

Arguments

cohort

A Cohort object.

path

Output file path, conventionally ending in .rds.

Value

path, invisibly.

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)