grapes-with-grapes: Convenience inflix operator to return a data.table of columns...

Description Usage Arguments Value Examples

Description

Convenience inflix operator to return a data.table of columns matching a regular expression.

Usage

1
dt %with% cols

Arguments

dt

A data.table.

cols

Vector of column patterns to include.

Value

A data.table subset of dt with column names matching cols.

Examples

1
2
3
4
5
6
7
8
9
library(magrittr)
library(data.table)
library(dt.inflix)

  dt <- data.table::data.table(a = c(1, 1, 1),
                               b = c(2, 2, 3))

  dto <- dt %with% "b"
  print(dto)

andrewrech/dt.inflix documentation built on Nov. 23, 2017, 10:08 a.m.