inside {admisc} | R Documentation |
Evaluate an R expression in an environment constructed from data.
inside(data, expr, ...) ## S3 method for class 'list' inside(data, expr, keepAttrs = TRUE, ...)
data |
Data to use for constructing an environment a |
expr |
Expression to evaluate, often a “compound” expression, i.e., of the form { a <- somefun() b <- otherfun() ..... rm(unused1, temp) } |
keepAttrs |
For the |
... |
Arguments to be passed to (future) methods. |
This is a modified version of the base R function within))
, with exactly
the same arguments and functionality but only one fundamental difference:
instead of returning a modified copy of the input data, this function alters the
data directly.
Adrian Dusa
mt <- mtcars inside(mt, hwratio <- hp/wt) dim(mtcars) dim(mt)