
Check if `df_input_response` is all 1s or 0s
util_check_for_ones_zeros.Rd
This function performs a quality check to determine whether `df_input_response` has only 1s or 0s as entries.
Examples
# Load example data, which has both 1s and 0s
data("df_input_response_example")
# This will return FALSE
util_check_for_ones_zeros(df_input_response = df_input_response_example)
#> [1] FALSE
# Create data frame with all 0s
df_zeroed <- data.frame(
date_of_evaluation = rep('2024-08-23', 6),
referent = c('Apple', 'Ball', 'Tablet', 'Pencil', 'Army Man', 'Mouse'),
conversing = rep(0, 6),
labeling = rep(0, 6),
echoing = rep(0, 6),
requesting = rep(0, 6)
)
# This will return TRUE
util_check_for_ones_zeros(df_input_response = df_zeroed)
#> [1] TRUE
# Create data frame with all 1s
df_ones <- data.frame(
date_of_evaluation = rep('2024-08-23', 6),
referent = c('Apple', 'Ball', 'Tablet', 'Pencil', 'Army Man', 'Mouse'),
conversing = rep(1, 6),
labeling = rep(1, 6),
echoing = rep(1, 6),
requesting = rep(1, 6)
)
# This will return TRUE
util_check_for_ones_zeros(df_input_response = df_ones)
#> [1] TRUE