Description Usage Arguments Value Author(s) Examples
This function subset OTUs and metadata based on user defined values of metadata variables.
1 | data.subset(data, meta, factors="", values="", and=TRUE)
|
data |
a list of otu tables to be processed.
See also |
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. |
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.
Wen Chen
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)
|
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"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.