Hello

I have been using numeric vectors to perform phylogenetic independent contrasts 
of several ecological variables for the cat phylogeny, using the ape package in 
r, and I was wondering how this can be done using categorical values?

Example of how I have been using numeric values:

tree <- read.newick("phylogeny.txt")

tree <- as.phylo(tree)

tree <- root(tree,1)

x<-c() # x would vectors, for instance rainfall. One value for each operational 
taxonomic unit on the tree, and the same order as they appear in the newick 
file.

pic.rain <- pic(x, tree, scaled = T, var.contrasts = F, rescaled.tree = F) # To 
generate the phylogenetic independent contrasts

cor.test(pic.rain,pic.rain) # To test for a correlation, obviously for rain and 
rain it would be 1.

How can this be done using data such as habitat, i.e grassland/forest/desert, 
or activity, i.e. nocturnal, diurnal etc?

I would be very grateful for any suggestions.

Kate.

        [[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