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:

     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)

