First, we load the package phylosignal
and the dataset
carnivora
from adephylo
.
Here is a phylogenetic tree of 19 carnivora species.
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.
## $stat
## Cmean I K K.star Lambda
## mass 0.5493887 0.3921068 0.71277467 0.7154914 9.640762e-01
## random -0.2724555 -0.2110678 0.09772298 0.0982796 6.846792e-05
## bm 0.3027499 0.2119550 0.59986919 0.5995905 1.009031e+00
##
## $pvalue
## Cmean I K K.star Lambda
## mass 0.001 0.002 0.001 0.001 0.001
## random 0.928 0.947 0.825 0.845 1.000
## bm 0.023 0.014 0.001 0.001 0.001