expand_colnames: Helper function to expand a range of columns given with ":"...

View source: R/wr_helpers.R

expand_colnamesR Documentation

Helper function to expand a range of columns given with ":" notation

Description

Given a data.table or data.frame and a string of column range using the ":", expand and find all columns within that range, including the columns stated as the beginning and end of the range

Usage

expand_colnames(dt, range)

Arguments

dt

a data.table or a data.frame

range

a string defining range of columns using ":" notation

Details

This helper function is useful for extracting and finding the columns between the bracket of column names provided. This is useful when evaluating the columns required when other wr_ functions use non-standard evaluation.

This function is used internally in the package and not exported

Examples

## Not run: 
mtcars
expand_colnames(mtcars, "mpg:hp")

## End(Not run)

kleu046/wr.data.table documentation built on April 25, 2022, 1:41 p.m.