gergness / srvyr

R package to add 'dplyr'-like Syntax for Summary Statistics of Survey Data
209 stars 27 forks source link

Fix #159, expand tests accordingly #160

Closed bschneidr closed 2 months ago

bschneidr commented 1 year ago

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.

gergness commented 2 months ago

Ah, thanks so much, sorry I just left this hanging, srvyr unfortunately fell into my procrastination pit