Skip to contents

This function performs a quality check to determine whether `df_input_response` has only 1s or 0s as entries.

Usage

util_check_for_ones_zeros(df_input_response, ind_check_only_for_zero = FALSE)

Arguments

df_input_response

A `data.frame` containing referent names and their associated responses, typically recorded by the listener. For example data, run `data("df_input_response_example")` or `data("df_input_response_previous_example")`.

ind_check_only_for_zero

Only evaluate if they are all zeros

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