thibautjombart / adegenet

adegenet: a R package for the multivariate analysis of genetic markers
169 stars 64 forks source link

`summary.spca` not working when `spca` run on matrices #328

Closed lvclark closed 2 years ago

lvclark commented 2 years ago

I ran spca on a matrix object containing my genotypes, but when I run summary or screeplot I get the error

Error in apply(X, 2, f1) : object 'X' not found

The issue seems to be here: https://github.com/thibautjombart/adegenet/blob/master/R/spca.R#L422

If the original object is not genind or genpop, no X object is created.

zkamvar commented 2 years ago

Thank you for bringing this up! Can you provide a MWE that I can use to fix and test this or if you have an idea of how you would fix this, would you want to create a PR?

lvclark commented 2 years ago

Sure, PR incoming!