| read_metadata | R Documentation |
Reads metadata from a CSV file and returns it as a data frame.
read_metadata(filename, header.col = TRUE, header.row = TRUE, sep = ",")
filename |
Path to the metadata CSV file. |
header.col |
Logical; whether the metadata file has a header row. |
header.row |
Logical; whether the metadata file has a row names column. |
sep |
Field separator used in the metadata file. |
A data.frame containing the imported metadata. Rows usually
correspond to samples and columns correspond to metadata variables.
meta_file <- tempfile(fileext = ".csv")
metadata_in <- data.frame(
class = c("A", "B", "A"),
batch = c("b1", "b1", "b2"),
row.names = c("s1", "s2", "s3")
)
utils::write.csv(metadata_in, meta_file)
read_metadata(meta_file, header.row = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.