set.seed(
1,
kind = "Mersenne-Twister",
normal.kind = "Inversion",
sample.kind = "Rejection"
)
phylo <- ape::rcoal(10)
phylo$tip.label <- c("bird_a", "bird_b", "bird_c", "bird_d", "bird_e",
"bird_f", "bird_g", "bird_h", "bird_i", "bird_j")
phylo <- phylobase::phylo4(phylo)
endemicity_status <- sample(c("not_present", "endemic", "nonendemic"),
size = length(phylobase::tipLabels(phylo)),
replace = TRUE, prob = c(0.8, 0.1, 0.1))
phylod <- phylobase::phylo4d(phylo, as.data.frame(endemicity_status))
phylod <- add_asr_node_states(
phylod = phylod,
asr_method = "parsimony"
)
island_tbl <- island_tbl()
extract_species_asr(
phylod = phylod,
species_label = "bird_i",
species_endemicity = "endemic",
island_tbl = island_tbl,
include_not_present = FALSE
)
Run the code above in your browser using DataLab