eapply                 package:base                 R Documentation

_A_p_p_l_y _a _F_u_n_c_t_i_o_n _o_v_e_r _v_a_l_u_e_s _i_n _a_n _e_n_v_i_r_o_n_m_e_n_t

_D_e_s_c_r_i_p_t_i_o_n:

     '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.

_U_s_a_g_e:

     eapply(env, FUN, ..., all.names = FALSE)

_A_r_g_u_m_e_n_t_s:

     env: environment to be used.

     FUN: the function to be applied, found _via_ 'match.fun'. In the
          case of functions like '+', '%*%', etc., the function name
          must be backquoted or quoted.

     ...: optional arguments to 'FUN'.

all.names: a logical indicating whether to apply the function to all
          values

_S_e_e _A_l_s_o:

     'lapply'.

_E_x_a_m_p_l_e_s:

     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)

