Description Usage Arguments Value Examples
Function to seacrh for a variable by its name. See the "Value" section for more details on the different functions.
1 2 3 4 5 | findvar_fun(df, ...)
findvar_in_df(pattern, df, ...)
findvar_anywhere(pattern, envir = .GlobalEnv, ...)
|
df |
A data.frame from where the column names should be identified when returned function applied |
... |
Arguments passed to |
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). |
findvar_fun
: A function with argument param
to search for param
in df
. See example!
findvar_in_df
: A vector with variable names from df matching the pattern.
findvar_anywhere
: Does not return anything but prints a message where variables matching the pattern can be found.
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")
|
[1] "speed"
[1] "speed"
iris: Petal.Length, Petal.Width
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.