Description Usage Arguments Details Value Note Author(s) References See Also Examples
View source: R/BioGeoBEARS_basics_v1.R
This function converts the 0110-type format of the
tipranges object into a list of strings describing the
geographic ranges. E.g., 1100 becomes AB, 0111 become
BCD (assuming the regions are abbreviated A, B, C...).
Users can input their preferred abbreviations with
areaabbr
.
1 | tipranges_to_area_strings(tipranges, areaabbr = NULL)
|
tipranges |
An object of class
|
areaabbr |
A vector of the abbreviations (preferably 1 character each). |
Note that you will HAVE to use
order_tipranges_by_tree_tips
on the
tipranges object first, to make sure the tipranges are in
the correct order on the tree tips.
tiprange_names
A vector of strings.
Go BEARS!
Nicholas J. Matzke matzke@berkeley.edu
http://phylo.wikidot.com/matzke-2013-international-biogeography-society-poster https://code.google.com/p/lagrange/
Matzke_2012_IBS
ReeSmith2008
SmithRee2010_CPPversion
order_tipranges_by_tree_tips
,
define_tipranges_object
,
save_tipranges_to_LagrangePHYLIP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # 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
tipranges_to_area_strings(tipranges=tipranges1, areaabbr=NULL)
tipranges_to_area_strings(tipranges=tipranges1, areaabbr=c("K", "O", "M", "H"))
# Reorder the tipranges object
tipranges2 = order_tipranges_by_tree_tips(tipranges1, tr)
tipranges2
tipranges_to_area_strings(tipranges=tipranges2, areaabbr=NULL)
tipranges_to_area_strings(tipranges=tipranges2, areaabbr=c("K", "O", "M", "H"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.