| findvar {rccmisc} | R Documentation |
Function to seacrh for a variable by its name. See the "Value" section for more details on the different functions.
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.
find_cars <- findvar_fun(cars)
find_cars("sp")
findvar_in_df("sp", cars)
cars <- cars; iris <- iris
findvar_anywhere("petal")