col_idx {egor} | R Documentation |
Obtain the index of a column in a data frame (or a list), producing an error if there is a problem.
Description
Obtain the index of a column in a data frame (or a list), producing an error if there is a problem.
Usage
col_idx(name, df)
Arguments
name |
a character vector giving the names of the columns to look up. |
df |
a |
Value
An integer giving the column index of the named column.
Note
Numeric inputs for name
are passed through, so this
function is safe to use if the input is already a column index.
[Package egor version 1.24.2 Index]