letter_strings_to_tipranges_df: Convert ranges in the form of letters (A, AB, BFG, etc.) to a...

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

View source: R/BioGeoBEARS_basics_v1.R

Description

This function converts ranges in the form of concatenated letters (A, AB, BFG, etc.) to binary state number codes. Via apply, this is done to each member of the entire input vector of strings. It outputs tipranges object.

Usage

1
2
3
  letter_strings_to_tipranges_df(letter_strings,
    letter_codes_in_desired_order = "alphabet",
    tipnames_in_order = NULL)

Arguments

letter_strings

A list of ranges in concatenated letter form ("A", "AB", "BFG", etc.)

letter_codes_in_desired_order

The letter codes in the desired order. The default keyword, "alphabet", uses the standard 26 capital letters; the output binary codes will thus have 26 positions. If the user inputs fewer letters here, or puts them in another order, those will be used.

tipnames_in_order

If given, the input tipnames will be applied as rownames in the tipranges object. Default is NULL, which results in numbering the rows.

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

Matzke_2012_IBS

See Also

letter_string_to_binary, binary_range_to_letter_code_list, binary_ranges_to_letter_codes, getranges_from_LagrangePHYLIP

Examples

1
2
3
4
5
6
7
testval=1
letter_strings = c("A", "B", "C", "AB", "AC", "BC", "ABC")
letter_strings_to_tipranges_df(letter_strings)

letter_strings = c("A", "B", "C", "AB", "AC", "BC", "ABC")
letter_strings_to_tipranges_df(letter_strings,
tipnames_in_order=paste("tip", seq(1,7), sep=""))

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