rdrop_annotations {aphylo} | R Documentation |
Randomly drop leaf annotations
Description
The function takes an annotated tree and randomly selects leaf nodes to set annotations as 9 (missing). The function allows specifying a proportion of annotations to drop, and also the relative probability that has dropping a 0 with respecto to a 1.
Usage
rdrop_annotations(
x,
pcent,
prob.drop.0 = 0.5,
informative = getOption("aphylo_informative", FALSE)
)
Arguments
x |
An object of class aphylo. |
pcent |
Numeric scalar. Proportion of the annotations to remove. |
prob.drop.0 |
Numeric scalar. Probability of removing a 0, conversely,
|
informative |
Logical scalar. If |
Value
x
with fewer annotations (more 9s).
Examples
# The following tree has roughtly the same proportion of 0s and 1s
# and 0 mislabeling.
set.seed(1)
x <- raphylo(200, Pi=.5, mu_d=c(.5,.5), psi=c(0,0))
summary(x)
# Dropping half of the annotations
summary(rdrop_annotations(x, .5))
# Dropping half of the annotations, but 0 are more likely to drop
summary(rdrop_annotations(x, .5, prob.drop.0 = 2/3))
[Package aphylo version 0.3-3 Index]