mixOmicsTeam / mixOmics

Development repository for the Bioconductor package 'mixOmics '
http://mixomics.org/
154 stars 51 forks source link

Fix for Issue #122 #195

Closed Max-Bladen closed 2 years ago

Max-Bladen commented 2 years ago

Implemented a check within the perf.mixo_splsda() function which prevents the method running if any of the classes have a single sample associated with them.

Also added to checks (in new file: test-perf.mixo_splsda.R) which ensures basic functionality as well as whether the function prevents a class with one sample being used.

aljabadi commented 2 years ago

@Max-Bladen exact error message matching could be tricky. For instance, there is a typo in the error message which if we fix it only in the function will result in an error here. What you can do instead is give errors classes, and expect the error to have your expected class. See class arg in tesstthat::expect_error.

Max-Bladen commented 2 years ago

Interesting. I'll have a look at this. My work to improve all the test cases (PR #206) is using exact matching for error messages. As I've been implementing it, it did seem a bit haphazard. I'll adjust these to implement the class system - should make this much more robust