Verify if the Kobo survey dataframe is valid
verify_valid_survey.Rd
This function checks whether the provided Kobo survey dataframe meets certain criteria:
It is a dataframe.
It is not empty.
It contains columns named "type" and "name".
Examples
# Assume df_valid is a valid Kobo survey dataframe
df_valid <- data.frame(type = c("integer", "selecte_one yesno"), name = c("age", "consent"))
verify_valid_survey(df_valid) # should return TRUE
#> [1] TRUE
# Assume df_invalid lacks the required columns
df_invalid <- data.frame(column1 = c("integer", "selecte_one yesno"), column2 = c("age", "consent"))
verify_valid_survey(df_invalid) # should return FALSE
#> [1] FALSE