Nothing
First, we load the package phylosignal
and the dataset carnivora
from adephylo
.
library(phylosignal) library(adephylo) library(ape) library(phylobase) data(carni19)
Here is a phylogenetic tree of 19 carnivora species.
tre <- read.tree(text=carni19$tre)
And we create a dataframe of 3 traits for the 19 carnivora species.
dat <- list() dat$mass <- carni19$bm dat$random <- rnorm(19, sd = 10) dat$bm <- rTraitCont(tre) dat <- as.data.frame(dat)
We can combine phylogeny and traits into a phylo4d
object.
p4d <- phylo4d(tre, dat)
barplot.phylo4d(p4d, tree.type = "phylo", tree.ladderize = TRUE)
phyloSignal(p4d = p4d, method = "all")
phylosim <- phyloSim(tree = tre, method = "all", nsim = 100, reps = 99)
plot(phylosim, stacked.methods = FALSE, quantiles = c(0.05, 0.95))
plot.phylosim(phylosim, what = "pval", stacked.methods = TRUE)
mass.crlg <- phyloCorrelogram(p4d, trait = "mass") random.crlg <- phyloCorrelogram(p4d, trait = "random") bm.crlg <- phyloCorrelogram(p4d, trait = "bm") plot(mass.crlg) plot(random.crlg) plot(bm.crlg)
carni.lipa <- lipaMoran(p4d) carni.lipa.p4d <- lipaMoran(p4d, as.p4d = TRUE) barplot.phylo4d(p4d, bar.col=(carni.lipa$p.value < 0.05) + 1, center = FALSE , scale = FALSE) barplot.phylo4d(carni.lipa.p4d, bar.col = (carni.lipa$p.value < 0.05) + 1, center = FALSE, scale = FALSE)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.