index_col: Get index of a dataframe column by name, or get a name by...

View source: R/index_col.R View source: R/index_col.R

index_colR Documentation

Get index of a dataframe column by name, or get a name by index

Description

Get index of a dataframe column by name, or get a name by index

Get index of a dataframe column by name, or get a name by index

Usage

index_col(data, column = NULL, id = NULL)

index_col(data, column = NULL, id = NULL)

Arguments

data

must be a dataframe

column

specify the column name to return the index

id

specify the index of wanted column to return the name

Details

Provide either an id or a name to return a name or an id respectively

Provide either an id or a name to return a name or an id respectively

Value

the index of column name, or the column name of the index

the index of column name, or the column name of the index

Author(s)

Ibrahim H. Elkhidir, originally

Ibrahim H. Elkhidir, originally

Examples

## Not run: 
index_col(iris, column = "Sepal.Length")
index_col(iris, id = 1)
index_col(iris, id = c(1, 2))

## End(Not run)
## Not run: 
index_col(iris, column = "Sepal.Length")
index_col(iris, id = 1)
index_col(iris, id = c(1, 2))

## End(Not run)

IbrahimHE/wrangler documentation built on March 27, 2022, 4:23 p.m.