columnIndexOf: Indices of data frame columns identified by name.

columnIndexOfR Documentation

Indices of data frame columns identified by name.

Description

Indices of data frame columns identified by name.

Usage

columnIndexOf(x, d, regexp = TRUE)

Arguments

x

name(s) of columns to be searched for

d

data frame whose columns shall be searched

regexp

If TRUE, x of character type are interpreted as regular expressions.

Value

indices of requested columns

Author(s)

Tomas Sieger

Examples

# Find indices of 'Petal.Length' and 'Sepal.Length' columns in the
# 'iris' data:
columnIndexOf(c('Sepal.Length','Petal.Length'),iris)

# Alternatively, using regular expressions:
columnIndexOf(c('.*Length'),iris)

tsieger/tsiMisc documentation built on Oct. 10, 2023, 10:24 p.m.