validate_logical_vector: Validate a Logical Subgroup Vector

View source: R/helper.R

validate_logical_vectorR Documentation

Validate a Logical Subgroup Vector

Description

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.

Usage

validate_logical_vector(subgroup, N, name = NULL)

Arguments

subgroup

A logical vector representing the subgroup to be validated.

N

Length the subgroup should have.

name

(Optional) A string indicating the name of group.

Details

This function performs two key validations:

  1. Checks if the subgroup vector is logical.

  2. Checks if the length of the subgroup vector matches the N.

Value

The original subgroup vector if it passes all validation checks.


imt documentation built on Sept. 11, 2024, 5:41 p.m.