phylo4com: Create community phylogenies object

Description Usage Arguments Details Value Methods Author(s) See Also Examples

Description

Function to combine species abundance data with phylogenetic information for a set of communities.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  ## S4 method for signature 'phylo4,numeric'
phylo4com(x, n, communityID, species,
    missing=c("warn", "OK", "fail"))
  ## S4 method for signature 'phylo4,matrix'
phylo4com(x, n, missing=c("warn", "OK", "fail"))
  ## S4 method for signature 'phylo4,data.frame'
phylo4com(x, n, missing=c("warn", "OK", "fail"))
  ## S4 method for signature 'phylo4d,missing'
phylo4com(x, n, cols)
  ## S4 method for signature 'phylo,ANY'
phylo4com(x, n, ..., check.node.labels = "keep")

Arguments

x

a phylogeny of class phylo4d, phylo4, or phylo

n

Vector of abundances of each species in each community, or abundance matrix with species as rows and sites as columns.

communityID

Vector of community labels corresponding to the abundance values (only used if n is a vector).

species

Vector of species labels corresponding to the abundance values (only used if n is a vector).

cols

Names of pre-existing phylo4d data columns to use as abundance data (only if n is missing)

check.node.labels

If x is a phylo object, what to do with node labels

missing

(not currently implemented) What to do if some requested node IDs or names are not in the tree: warn, do nothing, or stop with an error.

...

additional arguments to be passed to other methods

Details

TODO

If the species vector contains values that do not appear in the tree, they are ignored with a warning. If a community has fewer than one species matched in the tree, an error will result. In both cases, the behavior is simply a result of how the phylobase subset method works; see the help page for this method for more information.

Value

A phylo4com objects.

Methods

x = "phylo4", n = "numeric"

creates community phylogenies from a master phylo4 tree, a vector of abundances, a vector of corresponding community names/labels, and a vector of corresponding taxa names/labels

x = "phylo4", n = "matrix"

creates community phylogenies from a master phylo4 tree and a site-by-species abundance matrix.

x = "phylo4", n = "data.frame"

creates community phylogenies from a master phylo4 tree and a site-by-species abundance data.frame

x = "phylo", n = "ANY"

creates a phylobase tree from an object of class phylo

Author(s)

Jim Regetz (regetz@nceas.ucsb.edu)

See Also

subset in the phylobase package

Examples

1
2
3
4
5
  # Example of phylo4com construction
  data(weeds.data)
  data(weeds.tree)
  phylo4com(weeds.tree, weeds.data$cover, weeds.data$plot,
    weeds.data$taxa)

ecoPD documentation built on May 2, 2019, 5:22 p.m.