addTips: Add Tips to a Phylogenetic Tree

Description Usage Arguments Details Value See Also Examples

View source: R/addTips.R

Description

Add tips (i.e. species) to a phylogenetic tree according to their taxonomic classification.

Usage

1
2
3
4
5
6
7
8
9
addTips(
  phy,
  tips,
  sister,
  tax,
  insert = "crown",
  ignore.monophyly = FALSE,
  quiet = FALSE
)

Arguments

phy

An object of class phylo.

tips

A vector of mode "character" giving the names of the species to be added.

sister

A vector of mode "character" giving the names of the species to which tips should be added as sister species.

tax

A data frame in parent-child format.

insert

A character string indicating the positions where the species is to be inserted: "crown", "stem", "randomly", or any unambigous abbreviation of these. This option will only have an effect for species that have in the phylogeny more than one sister taxon of the rank at which the are inserted.

ignore.monophyly

Logical, indicating if monophyly should be considered when selecting the anchor point.

quiet

Logical, indicating if screen output should be suppressed.

Details

If only a species list is given with tips, the species are inserted based on the position of congeneric species in the phylogeney. As a consequence, species that have no congeners in the phylogeny cannot be inserted without giving information on the taxonomy of higher ranks, which can be done with tax.

Value

An object of class phylo.

See Also

dbReadTaxonomy for reading a taxonomy table from the postgreSQL database.

Examples

1
2
3
data(cetacea)
missing_species <- setdiff(cetacea$tax$spec, cetacea$tree$tip.label)
tre <- addTips(phy = cetacea$tree, tips = missing_species, insert = "crown")

heibl/megaptera documentation built on Jan. 17, 2021, 3:34 a.m.