Update the approve column if keep is in the Answer.surveycode and if the Answer.surverycode is not in the fail vector (failed attention check)
create_approve_col.Rd
Update the approve column if keep is in the Answer.surveycode and if the Answer.surverycode is not in the fail vector (failed attention check)
Arguments
- df
the batch data set provided by amazon
- keep
the keep character vector that gets returned from the discard_list function
- fail
character vector of participants that failed the attention check
Value
a data frame with the approve column manipulated: will have X is valid, empty character if not
Examples
clean_batch <- create_approve_col(batch, keep = keep, fail = failed)
#> Error in mutate_cols(.data, ..., caller_env = caller_env()): Problem with `mutate()` column `Approve`.
#> ℹ `Approve = dplyr::case_when(...)`.
#> ✖ object 'keep' not found
#> Caused by error in `Answer.surveycode %in% keep`:
#> ! object 'keep' not found