This fixes #159 to ensure that filtering of calibrated/PPS/twophase designs works in the special case where filtering removes every row in the dataset. I used an if statement based on checking for length(filtered_rows) == 0, because I think this should be faster than doing something like x$prob[setdiff(seq_along(x$prob), filtered_rows)] <- Inf. But I'm happy to edit this PR (or you can make any) if you'd prefer a different approach.
This fixes #159 to ensure that filtering of calibrated/PPS/twophase designs works in the special case where filtering removes every row in the dataset. I used an
if
statement based on checking forlength(filtered_rows) == 0
, because I think this should be faster than doing something likex$prob[setdiff(seq_along(x$prob), filtered_rows)] <- Inf
. But I'm happy to edit this PR (or you can make any) if you'd prefer a different approach.