skim                  package:scope                  R Documentation

_A_g_g_r_e_g_a_t_e _A_c_r_o_s_s _D_a_t_a _F_r_a_m_e _S_u_b_s_e_t_s _D_e_f_i_n_e_d _b_y _a _S_c_o_p_e _O_b_j_e_c_t.

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

     Apply a function to values in the specified data frame column,
     across each group of rows specified in the scope object.

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

     skim(x, this, FUN = "max", scope = NULL, ...)

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

       x: A data frame.

    this: A column name in 'x', the main argument to 'FUN'.

     FUN: An aggregate function.

   scope: A scope object, e.g. created by 'scope()'.

     ...: Extra arguments to pass to 'FUN'.

_D_e_t_a_i_l_s:

     The default scope is all rows.  The default function is
     'max(...)'.   Remember that 'skim()' returns a data vector, not a
     scope object.  For  functions that return one of their arguments
     (perhaps 'max' and 'min' but perhaps  not 'mean') the result of
     'skim()' can be passed back to 'scope()' to 'probe' for  the row
     from which the value originated.  There is a danger that more or
     fewer  than one row will be detected, so check with 'score()'.

_V_a_l_u_e:

     A vector of same length as 'this' giving aggregated values.

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

     'scope', 'score', 'scoop', 'probe'

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

     data(Theoph)
     #What is the maximum concentration for each subject?
     S <- scope(Theoph,'Subject')
     m <- skim(Theoph,'conc',scope=S)

