This function checks whether the columns in a data frame (or a vector) are of
type numeric, integer, or logical. It can return a logical vector indicating
whether each column matches these types, or, if index = TRUE
, it returns
the indices of the matching columns.
getNumFlag(data, index = FALSE)
If index = FALSE
(default), the function returns a logical vector
with one element for each column (or the vector itself), where TRUE
indicates that the column is of type numeric, integer, or logical, and
FALSE
indicates it is not. If index = TRUE
, the function returns an
integer vector containing the indices of the columns that are numeric,
integer, or logical.
A data frame or a vector. The function will check the data types
of the columns (if data
is a data frame) or the type of the vector.
A logical value. If FALSE
(default), the function returns a
logical vector indicating which columns are numeric, integer, or logical.
If TRUE
, it returns the indices of these columns.