MinimumLength {TreeSearch} | R Documentation |
Minimum and Maximum lengths possible for a character
Description
The smallest and largest length that a phylogenetic character can attain on any tree.
Usage
MinimumLength(x, compress = FALSE)
## S3 method for class 'phyDat'
MinimumLength(x, compress = FALSE)
## S3 method for class 'numeric'
MinimumLength(x, compress = NA)
## S3 method for class 'character'
MinimumLength(x, compress = TRUE)
## S3 method for class 'character'
MaximumLength(x, compress = TRUE)
MinimumSteps(x)
MaximumLength(x, compress = TRUE)
## S3 method for class 'numeric'
MaximumLength(x, compress = NA)
Arguments
x |
An object of class Inapplicable tokens should be denoted with the integer |
compress |
Logical specifying whether to retain the compression of a
|
Details
Ambiguous inapplicable states (e.g. {0, -}
) are currently replaced with the
plain inapplicable token -
, reflecting the current behaviour of Morphy.
Value
MinimumLength()
returns a vector of integers specifying the
minimum number of steps that each character must contain.
MaximumLength()
returns a vector of integers specifying the
maximum number of steps that each character can attain in a parsimonious
reconstruction on a tree. Inapplicable tokens are not yet supported.
Author(s)
Martin R. Smith (martin.smith@durham.ac.uk)
See Also
Other tree scoring:
CharacterLength()
,
IWScore()
,
LengthAdded()
,
MorphyTreeLength()
,
TaxonInfluence()
Examples
data("inapplicable.datasets")
myPhyDat <- inapplicable.phyData[[4]]
# load your own data with
# my.PhyDat <- as.phyDat(read.nexus.data("filepath"))
# or Windows users can select a file interactively using:
# my.PhyDat <- as.phyDat(read.nexus.data(choose.files()))
class(myPhyDat) # phyDat object
# Minimum length of each character in turn
MinimumLength(myPhyDat)
# Collapse duplicate characters, per phyDat compression
MinimumLength(myPhyDat, compress = TRUE)
# Calculate length of a single character from its textual representation
MinimumLength("-{-1}{-2}{-3}2233")
MaximumLength("----0011")