View source: R/ArtificialExtinction.R
ArtificialExtinction | R Documentation |
Remove tokens that do not occur in a fossil "template" taxon from a living taxon, to simulate the process of fossilization in removing data from a phylogenetic dataset.
ArtificialExtinction(
dataset,
subject,
template,
replaceAmbiguous = "ambig",
replaceCoded = "original",
replaceAll = TRUE,
sampleFrom = NULL
)
## S3 method for class 'matrix'
ArtificialExtinction(
dataset,
subject,
template,
replaceAmbiguous = "ambig",
replaceCoded = "original",
replaceAll = TRUE,
sampleFrom = NULL
)
## S3 method for class 'phyDat'
ArtificialExtinction(
dataset,
subject,
template,
replaceAmbiguous = "ambig",
replaceCoded = "original",
replaceAll = TRUE,
sampleFrom = NULL
)
ArtEx(
dataset,
subject,
template,
replaceAmbiguous = "ambig",
replaceCoded = "original",
replaceAll = TRUE,
sampleFrom = NULL
)
dataset |
Phylogenetic dataset of class |
subject |
Vector identifying subject taxa, by name or index. |
template |
Character or integer identifying taxon to use as a template. |
replaceAmbiguous , replaceCoded |
Character specifying whether tokens
that are ambiguous (
|
replaceAll |
Logical: if |
sampleFrom |
Vector identifying a subset of characters from which to
sample replacement tokens.
If |
Further details are provided in \insertCiteAsher2020;textualTreeTools.
Note: this simple implementation does not account for character contingency, e.g. characters whose absence imposes inapplicable or absent tokens on dependent characters.
A dataset with the same class as dataset
in which entries that
are ambiguous in template
are made ambiguous in subject
.
Martin R. Smith (martin.smith@durham.ac.uk)
set.seed(1)
dataset <- matrix(c(sample(0:2, 4 * 8, TRUE),
"0", "0", rep("?", 6)), nrow = 5,
dimnames = list(c(LETTERS[1:4], "FOSSIL"),
paste("char", 1:8)), byrow = TRUE)
artex <- ArtificialExtinction(dataset, c("A", "C"), "FOSSIL")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.