Read a metadata file
Examples
metadata_file <- tempfile(fileext = ".csv")
write.csv(
data.frame(
sample = paste0("s", 1:4),
condition = rep(c("treated", "control"), each = 2)
),
metadata_file, row.names = FALSE
)
read_metadata(metadata_file, id_col = "sample")
#> sample condition
#> s1 s1 treated
#> s2 s2 treated
#> s3 s3 control
#> s4 s4 control
