This function checks if a given vector is a logical vector (TRUE
/FALSE
)
and whether its length matches the number of rows in a specified matrix.
It is designed to validate subgroup vectors used for subsettin data.
validate_logical_vector(subgroup, N, name = NULL)
The original subgroup
vector if it passes all validation checks.
A logical vector representing the subgroup to be validated.
Length the subgroup should have.
(Optional) A string indicating the name of group.
This function performs two key validations:
Checks if the subgroup
vector is logical.
Checks if the length of the subgroup
vector matches the N.