order_tipranges_by_tree_tips: Reorder the rows in a 'tipranges' object, to correspond to...

Description Usage Arguments Value Note Author(s) References See Also Examples

View source: R/BioGeoBEARS_basics_v1.R

Description

The tipranges object, as read from a LAGRANGE/PHYLIP-style geography file, may not have the species names as the same order as they are in the tips of the tree. This function allows the user to reorder them to match the tree

Usage

1

Arguments

tipranges

An object of class tipranges.

tr

A phylo tree object.

Value

tipranges An object of class tipranges

Note

Go BEARS!

Author(s)

Nicholas J. Matzke matzke@berkeley.edu

References

http://phylo.wikidot.com/matzke-2013-international-biogeography-society-poster https://code.google.com/p/lagrange/

Matzke_2012_IBS

ReeSmith2008

SmithRee2010_CPPversion

See Also

tipranges_to_area_strings, define_tipranges_object, save_tipranges_to_LagrangePHYLIP

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
testval=1

# Get the example files directory
extdata_dir = np(system.file("extdata", package="BioGeoBEARS"))
# tmp hard code:
# extdata_dir = "/Dropbox/_njm/__packages/BioGeoBEARS_setup/inst/extdata/"
# Set the filename (Hawaiian Psychotria from Ree & Smith 2008)

trfn = np(paste(extdata_dir, "/Psychotria_5.2.newick", sep=""))
tr = read.tree(trfn)

fn = np(paste(extdata_dir, "/Psychotria_geog.data", sep=""))
tipranges1 = getranges_from_LagrangePHYLIP(lgdata_fn=fn)
tipranges1

# Reorder the tipranges object
tipranges2 = order_tipranges_by_tree_tips(tipranges1, tr)
tipranges2

BioGeoBEARS documentation built on May 29, 2017, 8:36 p.m.