Verify if the Kobo choices dataframe is valid
verify_valid_choices.Rd
This function checks whether the provided Kobo choices dataframe meets certain criteria:
It is a dataframe.
It is not empty.
It contains columns named "list_name" and "name".
Examples
# Assume df_valid_choices is a valid Kobo choices dataframe
df_valid_choices <- data.frame(list_name = c("ChoiceA", "ChoiceB"), name = c("Option1", "Option2"))
verify_valid_choices(df_valid_choices) # should return TRUE
#> [1] TRUE
# Assume df_invalid_choices lacks the required columns
df_invalid_choices <- data.frame(column1 = c("ChoiceA", "ChoiceB"),
column2 = c("Option1", "Option2"))
verify_valid_choices(df_invalid_choices) # should return FALSE
#> [1] FALSE