Draws the sample from the population, keeping the rows where the sampling
indicator S is 1. Name the indicator S, as in
declare_sampling(S = complete_rs(N, n = 50)), or say which rows to keep
with filter = ; a sampling step that produces neither keeps every row and
warns.
Arguments
- ...
(optional) Named arguments forwarded to
fabricatr::fabricate(). Unquoted expressions are evaluated lazily in the caller's environment with access to the current data frame.- filter
(optional) Unquoted expression evaluated against the data; rows where the expression is
TRUEare retained, andSis then not consulted.- label
(optional) Step label. Defaults to
"sampling".- draws
(optional) Number of nested draws for this step. Defaults to
1. When> 1, the step is re-executeddrawstimes for each upstream draw during nested simulation.
Value
A design_step (class c("design_step", "dd", "function")): a
function that takes the current data frame and returns the rows sampled,
with any declared columns added. Add it to a design with +.
See also
Other design declarations:
declare_assignment(),
declare_estimator(),
declare_inquiry(),
declare_measurement(),
declare_model(),
declare_notes(),
declare_parameters(),
declare_step(),
declare_test()