Skip to content

Commit

Permalink
Merge 77b72c5 into 3965a5c
Browse files Browse the repository at this point in the history
  • Loading branch information
nfultz committed Nov 1, 2019
2 parents 3965a5c + 77b72c5 commit 2f0ac49
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/declare_sampling.R
Expand Up @@ -42,7 +42,7 @@ declare_sampling <- make_declarations(sampling_handler, "sampling")
#' @importFrom rlang quos !!! call_modify eval_tidy quo
#' @importFrom randomizr draw_rs obtain_inclusion_probabilities
#' @rdname declare_sampling
sampling_handler <- function(data, ..., sampling_variable = "S") {
sampling_handler <- function(data, ..., sampling_variable = "S", keep = 1) {
## draw sample

options <- quos(...)
Expand All @@ -63,7 +63,7 @@ sampling_handler <- function(data, ..., sampling_variable = "S") {
S <- as.character(S)

## subset to the sampled observations
data[ data[[S]] %in% 1, names(data) != S, drop = FALSE]
data[ data[[S]] %in% keep,(length(keep) > 1) | names(data) != S, drop = FALSE]
}

validation_fn(sampling_handler) <- function(ret, dots, label) {
Expand Down

0 comments on commit 2f0ac49

Please sign in to comment.