Learn R Programming

egor (version 1.24.2)

col_idx: 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)

Value

An integer giving the column index of the named column.

Arguments

name

a character vector giving the names of the columns to look up.

df

a data.frame or a list object.