getNumFlag {folda} | R Documentation |
Identify Numeric, Integer, or Logical Columns in a Data Frame
Description
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.
Usage
getNumFlag(data, index = FALSE)
Arguments
data |
A data frame or a vector. The function will check the data types
of the columns (if |
index |
A logical value. If |
Value
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.