collapse: Collapse taxa in a 'nex' object

Description Usage Arguments Value Author(s) References Examples

View source: R/collapse.R

Description

Function to collapse and merge data across taxa

Usage

1
collapse(x, map, method = c("retain", "merge"))

Arguments

x

(required) a 'nex' object

map

a list specifying equivalent taxa to map from and to (e.g., ‘c(’spA' = 'spB')' will map all characters from spA to spB)

method

whether to convert characters scored in both taxa to polymorphisms ('merge') or retain original characters (default)

Value

an object of class nex for use in further phenotools functions

Author(s)

Chad Eliason celiason@fieldmuseum.org

References

Clarke, J. A., Zhou, Z., Zhang, F. (2006). Insight into the evolution of avian flight from a new clade of Early Cretaceous ornithurines from China and the morphology of Yixianornis grabaui. Journal of Anatomy, 208, 287–308.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
# load data matrix of Clarke et al. (2006)
x <- read.nex(system.file("extdata", "clarke_2006.nex", package = "phenotools"))
# merge 2 duck species into a new taxon (family Anatidae):
y <- collapse(x, map = c('Anas_platyrhynchos' = 'Anatidae', 'Chauna_torquata'
= 'Anatidae'), method = 'merge')
x$tax
y$tax

## End(Not run)

celiason/phenotools documentation built on Sept. 12, 2019, 6:49 p.m.