[R] Difficulty in caper: Error in phy$node.label[which(newNb > 0) - Ntip]

Nicole Thompson gavago at gmail.com
Wed Mar 6 16:49:49 CET 2013


Hello,

I'm doing a comparative analysis of mammal brain and body size data.
I'm following Charlie Nunn and Natalie Cooper's instructions for
"Running PGLS in R using caper".

I run into the following error when I create my comparative dataset,
combining my phylogenetic tree (mammaltree) and taxon measures
(mammaldata):

"Error in phy$node.label[which(newNb > 0) - Ntip] : only 0's may be
mixed with negative subscripts"

My full script is provided at the bottom.

I have looked at the caper manual by David Orme to understand how
comparative.data() constructs the dataset, but still cannot interpret
the error. Many thanks to anyone who could provide me with insight.

Nicole Thompson
E3B Columbia University



> library(caper)

Loading required package: ape

Loading required package: MASS

Loading required package: mvtnorm

>

> mammaldata <-read.csv("R.Mammal_data.csv", header = TRUE)

> mammaltree <-read.nexus("BEphylotree.nex")

> mammal <- comparative.data(phy = mammaltree, data = mammaldata, names.col = Taxon, vcv = TRUE, na.omit = FALSE, warn.dropped = TRUE) #names.col?

Error in phy$node.label[which(newNb > 0) - Ntip] : only 0's may be
mixed with negative subscripts





--
Nicole A Thompson
E3B Columbia University, NYCEP
nat2103 at columbia.edu
480.522.4212



More information about the R-help mailing list