findvar: Find variables by name

Description Usage Arguments Value Examples

Description

Function to seacrh for a variable by its name. See the "Value" section for more details on the different functions.

Usage

1
2
3
4
5

Arguments

df

A data.frame from where the column names should be identified when returned function applied

...

Arguments passed to grep

pattern

A character string with name (or part of name) of the variables to find.

envir

environment holding data.frames where to search for the variables (the Global environment as default).

Value

Examples

1
2
3
4
5
6
7
find_cars <- findvar_fun(cars)
find_cars("sp")

findvar_in_df("sp", cars)

cars <- cars; iris <- iris
findvar_anywhere("petal")

Example output

[1] "speed"
[1] "speed"
iris: Petal.Length, Petal.Width

rccmisc documentation built on May 2, 2019, 2:48 p.m.