eapply {base} | R Documentation |
eapply
applies FUN
to the named values from an
environment and returns the results as a list. The user can request
that all named objects are used (normally names that begin with a
dot are not). The output is not sorted and no parent environments are
searched.
eapply(env, FUN, ..., all.names = FALSE)
env |
environment to be used. |
FUN |
the function to be applied, found via
|
... |
optional arguments to |
all.names |
a logical indicating whether to apply the function to all values |
lapply
.
require(utils); require(stats)
env <- new.env()
env$a <- 1:10
env$beta <- exp(-3:3)
env$logic <- c(TRUE,FALSE,FALSE,TRUE)
# what have we there?
eapply(env, str)
# compute the mean for each list element
eapply(env, mean)
# median and quartiles for each list element
eapply(env, quantile, probs = 1:3/4)
eapply(env, quantile)