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.
col_idx(name, df)
name |
a character vector giving the names of the columns to look up. |
df |
a |
An integer giving the column index of the named column.
Numeric inputs for name
are passed through, so this
function is safe to use if the input is already a column index.