Learn R Programming

TreeTools (version 0.1.4)

StringToPhyDat: String to phyDat

Description

Converts a character string to a phyDat object.

Usage

StringToPhyDat(string, tips, byTaxon = TRUE)

StringToPhydat(string, tips, byTaxon = TRUE)

Arguments

string

String of tokens, optionally containing whitespace, with no terminating semi-colon.

tips

Character vector corresponding to the names (in order) of each taxon in the matrix.

byTaxon

Logical; if TRUE, string is one taxon's coding at a time; if FALSE, string is interpreted as one *character's coding at a time.

Value

This function returns a data matrix in phyDat format.

See Also

phyDat

Examples

Run this code
# NOT RUN {
morphy <- StringToPhyDat("-?01231230?-", c('Lion', 'Gazelle'), byTaxon = TRUE)
# encodes the following matrix:
# Lion     -?0123
# Gazelle  1230?-

# }

Run the code above in your browser using DataLab