plotROC
plotROC copied to clipboard
Make it work with single class or empty groups
When there is a single class on data or the group is empty, verify_d fails with an error (not an explicit error but a logic one) because it cannot guess the binary classes. But the desired behavior is to produce an empty plot.
Error in `geom_roc()`: Problem while computing stat.
ℹ Error occurred in the 1st layer.
Caused by error in `if (slev[1] == 0 & slev[2] == 1) ...`:
! missing value where TRUE/FALSE needed
This was a problem for me when attempting to calc_auc(p) on an empty group and didn't received NA as expected.
I did this PR on top of #84.