ericgoolsby / Rphylopars

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

Error in trait_data[, 1] : incorrect number of dimensions #22

Closed santelmovasconcelos closed 3 years ago

santelmovasconcelos commented 5 years ago

Dear Eric,

I'm trying to run the function phylopars and the following error appears: Error in trait_data[, 1] : incorrect number of dimensions

I've checked all tree tips and everything seems fine with the data frame.

Cheers,

Santelmo.

ericgoolsby commented 4 years ago

Hi Santelmo! I can think of one of two possibilities: 1) The first column of trait_data must be labeled "species" and must convey the species name for each row. You'll get an "incorrect number of dimensions" error if your trait data is missing the species column. 2) The other possibility is that I've stumbled across a few issues when there's only one trait in a dataset. This is because Rphylopars was tested on multivariate data (ntraits>1), which results in a few bugs due to the fact that, by default, R collapses 1-column matrices into vectors. I believe I've corrected this issue, but if addressing (1) doesn't fix your problem, I could try to reproduce the error with your inputs and see if I can diagnose the issue.

Thanks!