Hi Bruno, I had a similar problem. In my case, I had a set of  1000 trees
(from birdtree.org), and I dealt with it, by:

# Load packages
library(adephylo)
library(phytools)
library(geiger)

# Load data
data.base<- read.table(file = "data.base.txt", header = TRUE, row.names =
1);

# Load trees
n.trees <- 1000
trees<-read.nexus("tree.tre");

object_x  <- data.base$x
names(object_x)<-rownames(data.base)

# Check for mismatch data and trees
name.check(trees[[(1)]], object_x )

####  1) Pagel's lambda
lam.x = NULL;

for (i in 1:n.trees ) {
  lam.x [i] <- phylosig(trees[[(i)]], object_x, method="lambda", test=TRUE,
nsim=999)$lambda
  show(paste(round((i/n.trees)*100, digits = 1),"%"))
}
mean(lam.x)
min(lam.x)
max(lam.x)
sd(lam.x)


####  2)  Abouheif's Cmean
abouheif.x =  NULL
for (i in 1:n.trees ) {
  abouheif.x[i]    <-abouheif.moran(phylo4d(trees[[(i)]], object_x))$ pvalue
  show(paste(round((i/n.trees)*100, digits = 1),"%"))
}

mean(abouheif.x)
max(abouheif.x)
min(abouheif.x)
sd(abouheif.x)


####  3)    Blomberg's K
blo.x = NULL

for (i in 1:n.trees ) {
  blo.x [i] <- phylosig(trees[[(i)]], object_x, method="K", test=TRUE,
nsim=999)$K
  show(paste(round((i/n.trees)*100, digits = 1),"%"))
}

mean(blo.x)
max(blo.x)
min(blo.x)
sd(blo.x)



####  4)  Moran's I
mor.x =  NULL

for (i in 1:n.trees ) {
  mor.x[i] <- abouheif.moran(phylo4d(trees[[(i)]],
object_x),method="Abouheif")$ pvalue
  show(paste(round((i/n.trees)*100, digits = 1),"%"))
}

mean(mor.x)
min(mor.x)
max(mor.x)
sd(mor.x)



All the best,
- Carlos Biagolini-Jr.





On Thu, Dec 8, 2016 at 2:26 PM, Carturan, Bruno <bruno.cartu...@ubc.ca>
wrote:

> Bruno





-- 
Carlos Biagolini-Jr.

Doutorando em Ecologia

Laboratório de Comportamento Animal

Universidade de Brasília

CV-lattes <http://lattes.cnpq.br/4086237188108947> Research Gate
<https://www.researchgate.net/profile/Carlos_Biagolini>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to