Description Usage Arguments Details Value Author(s) Examples
Look for something in an object or anywhere in the active workspace
1 2 |
x |
An object to look in. |
what |
What to look for: either a character string or a regular expression. |
ls_opts |
A list of optional arguments passed |
... |
Additional arguments passed to methods, and eventually passed to |
Find something you're looking for in a specified object, or anywhere in the active workspace.
An object of class “lookfor” or “lookin”.
Thomas J. Leeper
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | require("datasets")
# look in a data.frame
data(USArrests)
## look for observation
lookin(USArrests, "Alaska")
## look for variable
lookin(USArrests, "Assault")
# look in an environment
x <- new.env()
x$mtcars <- mtcars
x$cars <- letters[1:10]
x$cards <- 1:5
lookin(x, "car")
# look in a list
data(mtcars)
x <- structure(mtcars, class = "list")
lookin(x, "mpg")
# look everywhere
lookfor("package")
# use regular expressions
## Look for car names containing letters and numbers (anywhere)
lookfor("[[:alpha:]]+ [[:digit:]]")
## Look for car names containing letters and numbers (in mtcars)
lookin(mtcars, "[[:alpha:]]+ [[:digit:]]")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.