OTU.subsets: Subset OTU And Metadata

Description Usage Arguments Value Author(s) Examples

Description

This function subset OTUs and metadata based on user defined values of metadata variables.

Usage

1
data.subset(data, meta, factors="", values="", and=TRUE)

Arguments

data

a list of otu tables to be processed. See also RAM.input.formatting.

meta

the metadata for subset.

factors

a vector containing metadata variables.

values

a vector containing values of interest in metadata variables.

and

logical. Determine whether all conditions needs to be met or not.

Value

The value returned by this function is a list containing otu tables matching the filtering requirement. The last item in the output list is the associated new metadata table fit the requirement.

Author(s)

Wen Chen

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
data(ITS1, ITS2, meta)
names(meta)
factors <- c("City", "Harvestmethod")
values <- c("City1", "Method1")
# match all requirements, and=TRUE
sub <- data.subset(data=list(ITS1=ITS1, ITS2=ITS2), meta=meta,
                   factors=factors, values=values, and=TRUE)
# match either of the requirements, and=FALSE
sub <- data.subset(data=list(ITS1=ITS1, ITS2=ITS2), meta=meta,
                   factors=factors, values=values, and=FALSE)
## Not run: 
names(sub)
ITS1.sub <- sub[["ITS1"]]
ITS2.sub <- sub[["ITS2"]]
meta.sub <- sub[["meta"]]

## End(Not run)

Example output

Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.5-4
Loading required package: ggplot2
sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
 [1] "Sample"         "City"           "Crop"           "Plots"         
 [5] "Harvestmethod"  "Harvestdate"    "Ergosterol_ppm" "Province"      
 [9] "Latitude"       "Longitude"     
[1] "ITS1" "ITS2" "meta"

RAM documentation built on May 2, 2019, 3:04 p.m.