getranges_from_LagrangePHYLIP: Read a LAGRANGE PHYLIP-style file containing geographic...

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

View source: R/BioGeoBEARS_basics_v1.R

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

1
  getranges_from_LagrangePHYLIP(lgdata_fn = "lagrange_area_data_file.data")

Arguments

lgdata_fn

The LAGRANGE geographic data file to be read.

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

Value

tipranges_object 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/

SmithRee2010_CPPversion

ReeSmith2008

Matzke_2012_IBS

See Also

define_tipranges_object, save_tipranges_to_LagrangePHYLIP

Examples

1
2
3
4
5
6
7
8
9
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)

Example output

Loading required package: rexpokit
Loading required package: cladoRcpp
Loading required package: ape
Loading required package: phylobase

Attaching package: 'phylobase'

The following object is masked from 'package:ape':

    edges

Read 6 items
Read 38 items
An object of class "tipranges"
numeric(0)
Slot "df":
                         K O M H
P_mariniana_Kokee2       1 0 0 0
P_mariniana_Oahu         0 1 0 0
P_mariniana_MauiNui      0 0 1 0
P_hawaiiensis_Makaopuhi  0 0 0 1
P_wawraeDL7428           1 0 0 0
P_kaduana_PuuKukuiAS     0 0 1 0
P_mauiensis_PepeAS       0 0 1 0
P_hawaiiensis_WaikamoiL1 0 0 1 0
P_mauiensis_Eke          0 0 1 0
P_fauriei2               0 1 0 0
P_hathewayi_1            0 1 0 0
P_kaduana_HawaiiLoa      0 1 0 0
P_greenwelliae07         1 0 0 0
P_greenwelliae907        1 0 0 0
P_grandiflora_Kal2       1 0 0 0
P_hobdyi_Kuia            1 0 0 0
P_hexandra_K1            1 0 0 0
P_hexandra_M             1 0 0 0
P_hexandra_Oahu          0 1 0 0

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