extract_date {OTUtable} | R Documentation |
Extract sampling date from a vector of sample names
Description
The date each sample was collected is encoded in the sample ID. Extract this into R date format using this command.
Usage
extract_date(sample_ids)
Arguments
sample_ids |
A vector of sample names. Samples must be labeled using the bog, layer, date, and replicate system (MAH04JUL05.R1 = Mary Lake Hypolimnion, 04Jul05, replicate 1) |
Value
Returns a vector of dates corresponding to each sample
Author(s)
Alexandra Linz <amlinz16@gmail.com>
Examples
samples <- c("TBE01JUN09.R1", "TBE05JUN09", "TBE10JUN09.R2")
extract_date(samples)
# Extract sample dates from the OTU table
data(otu_table)
x <- extract_date(colnames(otu_table))
# Extract sample dates from the metadata
data(metadata)
x <- extract_date(metadata$Sample_Name)
[Package OTUtable version 1.1.2 Index]