Learn R Programming

rase (version 0.2-22)

name.poly: Name & Order Polygons According to the Phylogeny

Description

Names polygons and orders them according to the phylogenetic tree. If they match the tree perfectly, the following message should appear: "tip labels and polygon names match and are in the same order".

Usage

name.poly(polygons, tree, poly.names = NA)

Arguments

polygons
list of polygons in owin.object format.
tree
phylogenetic tree of class "phylo".
poly.names
optional. Vector of names for the polygons. They should be in the same order as the polygons. If poly.names = NA, the function assumes the polygons are already named and only checks if they match the tip labels of the phylogenetic tree.

Value

Returns the polygon list with the names of the tip values in order.

See Also

shape.to.rase

Examples

Run this code
# attach polygon data
data(rase_data, package = 'rase')

## Not run: 
# # polygons already in format used by rase.
# psophia_poly
# 
# # check the phylogenetic tree
# psophia_tree
# 
# # Species names of polygons (in order)
# pnames <- c('dextralis', 'viridis', 'leucoptera', 'interjecta', 
#   'obscura', 'crepitans', 'ochroptera', 'napensis')
# 
# # check tree's' tip labels
# psophia_tree$tip.label
# 
# # name the polygons
# polygons <- name.poly(psophia_poly, psophia_tree, poly.names = pnames)
# ## End(Not run)

Run the code above in your browser using DataLab