helper_checkrow {whomds}R Documentation

Check a vector for particular values

Description

Check a vector for particular values

Usage

helper_checkrow(
  row,
  check_type = c("all_equal", "all_not_equal", "any_in"),
  check_value,
  na_rm = TRUE
)

Arguments

row

a vector of data

check_type

a string indicating the type of check to do on row. Options are "all_equal", "all_not_equal", and "any_in". A value of "all_equal" will check that all values in row equal check_value. A value of "all_not_equal" will check that all values of row are not equal to check_value. A value of "any_in" will check if any of the values in check_value are in row.

check_value

a vector of values to check against

na_rm

logical indicating whether or not to perform check after removing NAs, passed to argument na.rm of any() or all(). Default is TRUE.

Details

If all values of row are NA, then an NA is returned.

Value

a logical vector with the result of the check

See Also

Other helper functions: helper_palette(), helper_varslist()


[Package whomds version 1.1.1 Index]