data(carnivora)
### Using the formula interface:
co <- correlogram.formula(
log10(SW) ~ Order/SuperFamily/Family/Genus,
data=carnivora)
co
plot(co)
### Several correlograms on the same plot:
cos <- correlogram.formula(
log10(SW) + log10(FW) ~ Order/SuperFamily/Family/Genus,
data=carnivora)
names(cos)
plot(cos)
### Using the phylo interface:
### (the same analysis than in help(pic)...)
cat("((((Homo:0.21,Pongo:0.21):0.28,",
"Macaca:0.49):0.13,Ateles:0.62):0.38,Galago:1.00);",
file = "ex.tre", sep = "")
tree.primates <- read.tree("ex.tre")
X <- c(4.09434, 3.61092, 2.37024, 2.02815, -1.46968)
Y <- c(4.74493, 3.33220, 3.36730, 2.89037, 2.30259)
### Since this is a small tree, 2 classes is a reasonable number:
coX <- correlogram.phylo(X, tree.primates, nclass=2)
coY <- correlogram.phylo(Y, tree.primates, nclass=2)
plot(coX)
plot(coY)
### Nothing significant...
### Computing Moran's I on the whole matrix:
coX2 <- correlogram.phylo(X, tree.primates); coX2
### Significant at the 5% level
coY2 <- correlogram.phylo(Y, tree.primates); coY2
### Not significant
unlink("ex.tre") # delete the file "ex.tre"
Run the code above in your browser using DataLab