ericgoolsby / Rphylopars

Phylogenetic Comparative Tools for Missing Data and Within-Species Variation
28 stars 11 forks source link

Error message is opaque if trait data frame has improper names #19

Closed qdread closed 3 years ago

qdread commented 7 years ago

I got the following error message when I called phylopars() and passed a data frame to trait_data that did not have the first column named species. The first column contained species IDs but had a different name.

Error in tp(L = X, R = R, Rmat = as.matrix(Rmat), mL = ncol(X), mR = 1, : Mat::operator(): index out of bounds In addition: Warning messages: 1: In max(table(as.character(trait_data$species))) : no non-missing arguments to max; returning -Inf 2: In max(table(as.character(trait_data$species))) : no non-missing arguments to max; returning -Inf

This took me a long time to debug. It would be nice to either remove the requirement that the name be species or to make the error message more transparent. Thanks and I appreciate the great R package!

Jonathan-Abrahams commented 6 years ago

I second this.

Just wasted my afternoon because I had capitalized 'species'

ericgoolsby commented 3 years ago

Apologies. This should be fixed in the devel version ≥0.3.5 now.