col_idx: Obtain the index of a column in a data frame (or a list),...

View source: R/read.egonet.R

col_idxR 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 data.frame or a list object.

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.


egor documentation built on March 31, 2023, 11:33 p.m.