Description Usage Arguments Details Author(s) Examples
The data frames in a workspace are searched for variable names of interest and a vector of names is returned. The returned vector names the data frames that contain all of the variables of interest.
1 |
var |
A vector of variable names to search for. Only data frames containing all of the variables given will be returned. |
This function was written in response to the following query:
"I have a workspace attached in R. it's got objects in it. some of the objects are data frames. I'd like to search the dataframes in the workspace for a variable called THGRP and get a listing of dataframes that contain it. how I do this?"
Benjamin Nutter
1 2 3 4 5 6 7 8 9 10 11 12 | mtcarsA <- mtcars
mtcarsB <- mtcars
mtcarsB$newVar <- 1:nrow(mtcarsB)
IndomethA <- Indometh
findVariable("am")
findVariable(c("am", "mpg"))
findVariable(c("am", "newVar"))
findVariable("time")
# cleanup
rm(list=c('mtcarsA', 'mtcarsB', 'IndomethA'))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.