TreeTools (version 0.1.3)

PhyToString: phyDat to String

Description

Extract character data from a phyDat object as a string.

Usage

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)

Arguments

phy

An object of class phyDat

parentheses

Character specifying format of parentheses with which to surround ambiguous tokens. Choose from: { (default), [, (, <.

collapse

Character specifying text, perhaps ,, with which to separate multiple tokens within parentheses

ps

Character specifying text, perhaps ;, to append to the end of the string

useIndex

Logical (default: TRUE) specifying whether to print duplicate characters multiple times, as they appeared in the original matrix

byTaxon

Logical. If TRUE, write one taxon followed by the next. If FALSE, write one character followed by the next.

concatenate

Logical specifying whether to concatenate all characters/taxa into a single string, or to return a separate string for each entry.

Value

PhyToString returns a character vector listing a text representation of the phylogenetic character state for each taxon in turn.

See Also

Examples

Run this code
# NOT RUN {
fileName <- paste0(system.file(package='TreeTools'),
                   '/extdata/input/dataset.nex')
phyDat <- ReadAsPhyDat(fileName)
PhyToString(phyDat, concatenate = FALSE)

# }

Run the code above in your browser using DataLab