grunwaldlab / poppr

🌶 An R package for genetic analysis of populations with mixed (clonal/sexual) reproduction
https://grunwaldlab.github.io/poppr
68 stars 26 forks source link

Fix `bruvo.between()` test fixture #242

Closed zkamvar closed 3 years ago

zkamvar commented 3 years ago

This fixes #241 by updating the test fixture for bruvo.between()

It's worth noting that this test was not incorrect numerically because it was only considering the output from the distance matrix, which was a lower triangle. Because the values that are recycled end up being thrown away in the distance object, it was okay for us to construct one without needing to supply the other side of the matrix.

This fixes the issue by adding a helper function to fill in the correct values of the matrix and then convert to a distance to avoid the error thrown by R when not supplying a vector with the correct number of values for the matrix.

zkamvar commented 3 years ago

Accepted to CRAN, merging