Parses Nexus file, reading character states and names
ReadCharacters(filepath, character_num = NULL, session = NULL)ReadTntCharacters(filepath, character_num = NULL, session = NULL)
ReadAsPhyDat(filepath)
ReadTntAsPhyDat(filepath)
PhyDat(dataset)
character string specifying location of file
Index of character(s) to return.
NULL
, the default, returns all characters.
(optionally) a Shiny session with a numericInput named character_num whose maximum should be updated.
list of taxa and characters, in the format produced by read.nexus.data: a list of sequences each made of a single vector of mode character, and named with the taxon name.
A matrix whose row names correspond to tip labels, and column names
correspond to character labels, with the attribute state.labels
listing the state labels for each character; or a character string
explaining why the character cannot be returned.
ReadTntCharacters
: Read characters from TNT file
ReadAsPhyDat
: Read nexus characters as phyDat object
ReadTntAsPhyDat
: Read TNT characters as phyDat object
PhyDat
: A convenient wrapper for phangorn's phyDat
,
which converts a list of morphological characters into a phyDat object.
If your morphological characters are in the form of a matrix, perhaps because
they have been read using read.table
, try MatrixToPhyDat instead.
Tested with nexus files downloaded from MorphoBank with the "no notes" option, but should also work more generally.
Do report incorrectly parsed files.
Maddison, D. R., Swofford, D. L. and Maddison, W. P. (1997) NEXUS: an extensible file format for systematic information. Systematic Biology, 46, 590-621.