extract_date: Extract sampling date from a vector of sample names

Description Usage Arguments Value Author(s) Examples

Description

The date each sample was collected is encoded in the sample ID. Extract this into R date format using this command.

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)

OTUtable documentation built on May 1, 2019, 10:51 p.m.