Learn R Programming

BioGeoBEARS (version 0.2.1)

getranges_from_LagrangePHYLIP: Read a LAGRANGE PHYLIP-style file containing geographic ranges into a tipranges object

Description

Given some geographic range data for tips in the Lagrange C++/PHYLIP format (Smith et al. (2010)), this function imports the range data into a tipranges-class data.frame structure.

Usage

getranges_from_LagrangePHYLIP(lgdata_fn = "lagrange_area_data_file.data")

Arguments

lgdata_fn
The LAGRANGE geographic data file to be read.

Value

tipranges_object An object of class tipranges

Details

LAGRANGE C++ geographic range files are ASCII text files with the format:

19 4 (A B C D) P_mariniana_Kokee2 1000 P_mariniana_Oahu 0100 P_mariniana_MauiNui 0010 P_hawaiiensis_Makaopuhi 0001 P_wawraeDL7428 1000 [...]

The first row specifies the number of taxa (here, 19), the number of areas (here, 4), and finally, the names/abbreviations of the areas. The rest of the rows give the taxon names, followed by a tab and then the presence/absence in each range with 1s/0s.

The file above is part of the geographic range data for the Hawaiian Psychotria dataset used by Ree et al. (2008).

References

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

SmithRee2010_CPPversion

ReeSmith2008

Matzke_2012_IBS

See Also

define_tipranges_object, save_tipranges_to_LagrangePHYLIP

Examples

Run this code
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)
fn = np(paste(extdata_dir, "/Psychotria_geog.data", sep=""))
getranges_from_LagrangePHYLIP(lgdata_fn=fn)

Run the code above in your browser using DataLab