plotROC icon indicating copy to clipboard operation
plotROC copied to clipboard

Make it work with single class or empty groups

Open pslacerda opened this issue 1 year ago • 1 comments

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.

pslacerda avatar Sep 10 '24 00:09 pslacerda

I did this PR on top of #84.

pslacerda avatar Sep 10 '24 01:09 pslacerda