scoop                 package:scope                 R Documentation

_L_o_o_k _U_p _C_o_l_u_m_n _V_a_l_u_e_s _f_o_r _R_o_w_s _I_n _S_c_o_p_e

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

     For each vector of row.names in 'scope', 'scoop()' will try to
     retrieve a value  from the specified column.  If the vector
     contains exactly one row.name, the  corresponding value will be
     returned.  Otherwise, NA is returned. If scope is  not specified,
     the specified column is returned.

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

     scoop(x, this, scope = NULL, ...)

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

       x: A data frame.

    this: A column name in 'x', from which values are taken.

   scope: A scope object, ideally all elements atomic.

     ...: extra arguments, currently unused.

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

     A vector of same length as the data frame columns, and same mode
     as 'this'.

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

     'scope', 'score', 'skim', 'probe',

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

     data(Theoph)
     #Consider earliest row for each Subject, and return 'conc'.
     S <- scope(Theoph,'Subject')
     S2 <-scope(Theoph,'Time',that=0,scope=S)
     any(score(S2)!=1)
     scoop(Theoph,'conc',scope=S2)

