get_col_indexes: Get column indexes of a dataframe

Description Usage Arguments Examples

View source: R/get_col_indexes.R

Description

Reads a dataframe and returns the column indexes that match to a specific pattern. If input is not a dataframe, returns an error. You can set the first argument as.data.frame(x).

Usage

1

Arguments

x

A dataframe to with the columns of interest

id

Vector contaning character identifiers for the columns of interest. You can match the column names partially (see example).

Examples

1
2
3
4
5
x <- data.frame(one = 1, two = 2, three = 3, four = 4)
vect <- c("o", "wo")

get_col_indexes(x, "wo")
get_col_indexes(x, vect)

tkostas/komics documentation built on May 24, 2019, 7:31 a.m.