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.7127747 0.7154914 9.640762e-01
## random -0.2709054 -0.1801528 0.1236064 0.1255526 6.846792e-05
## bm 0.2994756 0.1597815 0.4867020 0.4829169 1.008786e+00
##
## $pvalue
## Cmean I K K.star Lambda
## mass 0.001 0.001 0.001 0.001 0.001000000
## random 0.940 0.900 0.547 0.539 1.000000000
## bm 0.023 0.024 0.001 0.002 0.006068963