The drop_detect function detects participants who drop out of the survey by recognizing NA sequences up to the last question of the survey. Additionally, the function provides the column name and index where the dropout occurs.
Value
A dataframe containing the following columns:
drop: A logical value indicating whether dropout has occurred (
TRUEfor dropout,FALSEotherwise).drop_index: The index of the column where dropout occurred (
NAif no dropout).column: The name of the column where the dropout occurred (
<NA>if no dropout).
Examples
if (FALSE) {
# Example usage with the 'flying' dataframe
detect_result <- drop_detect(flying)
print(detect_result)
}
