library(wiritttes) options(warn = 2) filename <- find_path("toy_example_4.RDa") file <- read_file(filename) posterior_1 <- get_posterior_by_index(file, 1)$trees posterior_2 <- get_posterior_by_index(file, 2)$trees posterior_3 <- get_posterior_by_index(file, 3)$trees posterior_4 <- get_posterior_by_index(file, 4)$trees testit::assert(tracerer::is_trees_posterior(posterior_1) == TRUE) testit::assert(tracerer::is_trees_posterior(posterior_2) == TRUE) testit::assert(tracerer::is_trees_posterior(posterior_3) == TRUE) testit::assert(tracerer::is_trees_posterior(posterior_4) == TRUE) # All same posteriors are identical testit::assert(are_identical_trees_posteriors(posterior_1, posterior_1) == TRUE) testit::assert(are_identical_trees_posteriors(posterior_2, posterior_2) == TRUE) testit::assert(are_identical_trees_posteriors(posterior_3, posterior_3) == TRUE) testit::assert(are_identical_trees_posteriors(posterior_4, posterior_4) == TRUE) # All different posteriors are different testit::assert(are_identical_trees_posteriors(posterior_1, posterior_2) == FALSE) testit::assert(are_identical_trees_posteriors(posterior_1, posterior_3) == FALSE) testit::assert(are_identical_trees_posteriors(posterior_1, posterior_4) == FALSE) testit::assert(are_identical_trees_posteriors(posterior_2, posterior_3) == FALSE) testit::assert(are_identical_trees_posteriors(posterior_2, posterior_4) == FALSE) testit::assert(are_identical_trees_posteriors(posterior_3, posterior_4) == FALSE)
multiphylo_1 <- posterior_1 multiphylo_2 <- posterior_2 multiphylo_3 <- posterior_3 multiphylo_4 <- posterior_4 class(multiphylo_1) <- "multiPhylo" class(multiphylo_2) <- "multiPhylo" class(multiphylo_3) <- "multiPhylo" class(multiphylo_4) <- "multiPhylo" phangorn::densiTree(multiphylo_1, type = "cladogram", alpha = 1) phangorn::densiTree(multiphylo_2, type = "cladogram", alpha = 1) phangorn::densiTree(multiphylo_3, type = "cladogram", alpha = 1) phangorn::densiTree(multiphylo_4, type = "cladogram", alpha = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.