Closed david20011999 closed 10 months ago
I've not sent a Pull Request due it is a small thing
@david20011999 cool catch! Do provide a PR so you simplify the work for @gaynorr ;)
@david20011999, thanks for reporting this. Sadly, it's not the first time I've been hit with this bug.
I have tried to import an haplotype of just one segSite but an error occurs. It is due when each haplotype for each chromosome is selected (file R/importData.R, line 279) you are substraccting elements from a matrix. Nevertheless, by default R convert it to a simpler object. It just happens when it is substracting 1 segSite (1 column) and it becomes a vector. Being a vector instead a matrix newMapPop function aborts. You can solve it easlily with the function as.matrix or adding haplo[,take, drop = F] on the mentioned line.
Thanks ;)
If you want to test it, here you have an example: