findvar {rccmisc}R Documentation

Find variables by name

Description

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

Usage

findvar_fun(df, ...)

findvar_in_df(pattern, df, ...)

findvar_anywhere(pattern, envir = .GlobalEnv, ...)

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

find_cars <- findvar_fun(cars)
find_cars("sp")

findvar_in_df("sp", cars)

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

[Package rccmisc version 0.3.7 Index]