Convert between strings and phyDat objects
PhyDatToString()
converts a phyDat
object as a
string;
StringToPhyDat()
converts a string of character data to a phyDat
object.
StringToPhyDat(string, tips, byTaxon = TRUE) StringToPhydat(string, tips, byTaxon = TRUE) PhyToString( phy, parentheses = "{", collapse = "", ps = "", useIndex = TRUE, byTaxon = TRUE, concatenate = TRUE ) PhyDatToString( phy, parentheses = "{", collapse = "", ps = "", useIndex = TRUE, byTaxon = TRUE, concatenate = TRUE ) PhydatToString( phy, parentheses = "{", collapse = "", ps = "", useIndex = TRUE, byTaxon = TRUE, concatenate = TRUE )
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 |
phy |
An object of class |
parentheses |
Character specifying format of parentheses with which to
surround ambiguous tokens. Choose from: |
collapse |
Character specifying text, perhaps |
ps |
Character specifying text, perhaps |
useIndex |
Logical (default: |
concatenate |
Logical specifying whether to concatenate all characters/taxa into a single string, or to return a separate string for each entry. |
StringToPhyDat()
returns an object of class phyDat
.
PhyToString()
returns a character vector listing a text
representation of the phylogenetic character state for each taxon in turn.
Martin R. Smith (martin.smith@durham.ac.uk)
Other phylogenetic matrix conversion functions:
MatrixToPhyDat()
StringToPhyDat("-?01231230?-", c('Lion', 'Gazelle'), byTaxon = TRUE) # encodes the following matrix: # Lion -?0123 # Gazelle 1230?- fileName <- paste0(system.file(package='TreeTools'), '/extdata/input/dataset.nex') phyDat <- ReadAsPhyDat(fileName) PhyToString(phyDat, concatenate = FALSE)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.