get.rank: Get OTUs Classified at Taxonomic Rank(s)

Description Usage Arguments Value Author(s) Examples

Description

This function returns the OTUs of the given OTU table(s) which areclassified at the given taxonomic rank.

Usage

1
get.rank(otu1, otu2 = NULL, rank = NULL)

Arguments

otu1

the first OTU table to be used.

otu2

the second OTU table to be used.

rank

a character vector representing a rank. Must be in one of three specific formats (see RAM.rank.formatting for help). If omitted, the function will repeat for all seven major taxonomic ranks.

Value

The value returned by this function may become nested lists, so for convenience, any nested lists have been given descriptive items names to make accessing its elements simple (see Examples).

Author(s)

Wen Chen and Joshua Simpson.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
    data(ITS1, ITS2)
    # the following are equivalent:
    ITS1.p <- get.rank(ITS1, rank="p")
    # this list has get.rank(ITS1, rank="k"),
    #               get.rank(ITS1, rank="p"), ...
    lst <- get.rank(ITS1)
    stopifnot(identical(ITS1.p, lst$phylum))
    # true
    # get a list of length 2: the item holds all ITS1 data, the
    # second holds ITS2 data
    lst.all <- get.rank(ITS1, ITS2)
    stopifnot(identical(ITS1.p, lst.all$otu1$phylum))

Example output

Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.4-4
Loading required package: ggplot2
sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
Warning message:
In get.rank(otu1 = otu1, rank = i) :
  no OTUs classified at the species level.
Warning messages:
1: In get.rank(otu1 = otu1, rank = i) :
  no OTUs classified at the species level.
2: In get.rank(otu1 = otu1, rank = i) :
  no OTUs classified at the species level.

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