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

Description Usage Arguments Value Author(s) See Also Examples

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

1
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.

Author(s)

Ignacio Quintero

See Also

shape.to.rase

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
  # 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)

rase documentation built on May 2, 2019, 12:46 p.m.