Cleans survey data by filtering out rows based on a specified scenario variable.
Arguments
- x
A data frame or tibble containing survey data.
- var_scenario
A character string specifying the name of the scenario variable to use for filtering.
TRUE/1value means we want to drop that response andFALSE/0value means we want to keep it.
- snapshot_data
Logical. If
TRUE, a snapshot of the data is taken. IfFALSE, snapshot without data is taken. IfNULL, no snapshot is taken.
Examples
if (FALSE) { # \dontrun{
data("srv_example", package = "g6tr.survey")
x <- srv_example |>
mutate(
flag_cs_01 = response_duration < 600,
flag_cs_02 = response_duration < 900) |>
select("response_id", starts_with("flag_cs_"), d_urban)
x <- x |>
step_clean_data("flag_cs_01")
} # }