findvarname: findvarname, fvn, & fv

Description Usage Arguments Details Examples

View source: R/findvarname.R

Description

List variable names / vector items which match a search expression

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
findvarname(pattern, data = NULL)

fvn(data, pattern)

## S3 method for class 'data.frame'
fvn(data, pattern)

## Default S3 method:
fvn(data, pattern)

fv(data, pattern)

Arguments

pattern

A character string regex search expression

data

A data.frame object

Details

findvarname is a legacy function specific to data.frames. The fvn function works for character vectors and data.frames. If the input is a data.frame, the matching variable names are sorted into alphabetical order. If the input is a character vector, the values are returned in the original order.

The function fv allows for non-standard evaluation, i.e., the search pattern does not need to be in quotes.

Examples

1
2
3
4
findvarname("length", iris)
fvn(iris, "Sepal")
fvn(sample(letters,125, replace = TRUE), "A|G")
iris %>% fv(Sepal)

thomasgstewart/tgsify documentation built on June 18, 2020, 11:10 a.m.