find_column {Tivy} | R Documentation |
Find column by pattern matching
Description
Searches for a column in a data frame using multiple pattern options. If multiple columns match, warns the user and returns the first match.
Usage
find_column(patterns, column_names, verbose = FALSE)
Arguments
patterns |
Character vector of regex patterns to search for. |
column_names |
Character vector of column names to search in. |
verbose |
Logical. If TRUE, prints detailed matching information. |
Value
Integer index of the first matching column, or NULL if no match found.
Examples
cols <- c("codigo_faena", "numero_cala", "especie", "especies_capturadas")
species_patterns <- c("especie", "species", "sp")
col_index <- find_column(species_patterns, cols)
[Package Tivy version 0.1.0 Index]