Learn R Programming

faux (version 1.2.1)

getcols: Get data columns

Description

Get columns from a data table by specifying the index, column name as a string, or unquoted column name. Returns the column names or indices.

Usage

getcols(data, ..., as_index = FALSE)

Value

vector of column names or indices

Arguments

data

the existing tbl

...

Columns to get

as_index

return the column indices (defaults to name)

Examples

Run this code
getcols(mtcars, 1, cyl, "disp", 5:7)

Run the code above in your browser using DataLab