| MorphyWeights | R Documentation |
MorphyWeights() details the approximate and exact weights associated with
characters in a Morphy object; SetMorphyWeights() edits them.
MorphyWeights(morphyObj)
SetMorphyWeights(weight, morphyObj, checkInput = TRUE)
morphyObj |
Object of class |
weight |
A vector listing the new weights to be applied to each character |
checkInput |
Whether to sanity-check input data before applying.
Defaults to |
MorphyWeights() returns a data frame with two named rows and
one column per character pattern:
row 1, approx, is a list of integers specifying the approximate (integral)
weights used by MorphyLib;
row 2, exact, is a list of numerics specifying the exact weights specified
by the user.
SetMorphyWeights() returns the Morphy error code generated when
applying weight.
Martin R. Smith (martin.smith@durham.ac.uk)
Other Morphy API functions:
GapHandler(),
MorphyErrorCheck(),
PhyDat2Morphy(),
SingleCharMorphy(),
UnloadMorphy(),
is.morphyPtr(),
mpl_apply_tipdata(),
mpl_attach_rawdata(),
mpl_attach_symbols(),
mpl_delete_Morphy(),
mpl_delete_rawdata(),
mpl_first_down_recon(),
mpl_first_up_recon(),
mpl_get_charac_weight(),
mpl_get_gaphandl(),
mpl_get_num_charac(),
mpl_get_num_internal_nodes(),
mpl_get_numtaxa(),
mpl_get_symbols(),
mpl_init_Morphy(),
mpl_new_Morphy(),
mpl_second_down_recon(),
mpl_second_up_recon(),
mpl_set_charac_weight(),
mpl_set_num_internal_nodes(),
mpl_set_parsim_t(),
mpl_translate_error(),
mpl_update_lower_root(),
mpl_update_tip(),
summary.morphyPtr()
tokens <- matrix(c(
0, 0, 0, 1, 1, 2,
0, 0, 0, 0, 0, 0), byrow = TRUE, nrow = 2L,
dimnames = list(letters[1:2], NULL))
pd <- TreeTools::MatrixToPhyDat(tokens)
morphyObj <- PhyDat2Morphy(pd)
MorphyWeights(morphyObj)
if (SetMorphyWeights(c(1, 1.5, 2/3), morphyObj) != 0L) message("Errored")
MorphyWeights(morphyObj)
morphyObj <- UnloadMorphy(morphyObj)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.