powered by
Validates a logical vector to ensure it meets specific criteria:
Must have a length of at least 1.
Must be a logical-type vector.
If all values are NA, it will raise a warning.
validate_logical_vec(logical_vec)
TRUE if the logical vector is valid, otherwise it throws an error.
TRUE
Logical vector to validate.
is_proportion, is_count, validate_proportion, validate_count
is_proportion
is_count
validate_proportion
validate_count
validate_logical_vec(c(TRUE, FALSE, TRUE)) # TRUE try(validate_logical_vec(c())) # Error validate_logical_vec(c(NA, NA)) # Warning
Run the code above in your browser using DataLab