vs: Search for columns containing string

Description Usage Arguments Details Examples

View source: R/vs.r

Description

vs returns a vector of all column names that contain the string chars

Usage

1
vs(chars = "", ds, ignore_case = TRUE)

Arguments

chars

the character string to search for in the column names of ds

ds

object (i.e. data.frame) whose column names will be searched

ignore_case

if TRUE then the case of chars and the column names of ds are ignored, otherwise, it will only match if the case matches

Details

This function is meant to help you find the column name of interest when there are too many columns to visually search for the one you want

Examples

1
2
3
4
5
6
data = data.frame(apple = 1:4,
                  orange = 5:8,
                  orangutan = 2:5,
                  applause = 3:6)

vs("oran", data)

funding-analytics-packages/mattfun documentation built on Dec. 1, 2019, 12:31 a.m.