Learn R Programming

RAM (version 1.2.1.3)

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

Description

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

Usage

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).
  • If otu2 is given:
    • If rank is given: a list containing two data frames (otu1 and otu2 selected at the given rank).
    • If rank is not given: a list containing two lists. The first sublist represents otu1, the second otu2. The sublists contain seven data frames, which are the OTU tables selected at each taxonomic rank (see Examples).
  • If otu2 is not given:
    • If rank is given: a single data frame (otu1 selected at the given rank).
    • If rank is not given: a list containing seven data frames (otu1 selected at each taxonomic rank).

Examples

Run this code
    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))

Run the code above in your browser using DataLab