Draw a systematic sample from a dataset of all potential samples

get_sample_systematic(x, n_sample, rounding = c("floor", "ceiling"))

Arguments

x

A data.frame of all potential samples

n_sample

Number of sample required

rounding

Should the result be rounded up (ceiling) or rounded down (floor)? Default is rounded down.

Value

A data.frame drawn from x that contains the sample selected systematically

Author

Ernest Guevarra

Examples

get_sample_systematic(x = village_list, n_sample = 30)
#> # A tibble: 36 × 4 #> id village population cluster #> <dbl> <chr> <dbl> <chr> #> 1 2 BODO GOUALGA 1974 3 #> 2 4 DJIMTILO 309 NA #> 3 6 NANAMI 433 5 #> 4 8 LAFIA 2 211 NA #> 5 10 MESSIO 915 6 #> 6 12 WOROKEME 471 7 #> 7 14 MAGAM KOTOKO 477 NA #> 8 16 HADAMARY 64 NA #> 9 18 FARCH 1 696 9 #> 10 20 MADINA 1 889 NA #> # … with 26 more rows