collectContents         package:Rcompression         R Documentation

_T_o_o_l_s _t_o _g_a_t_h_e_r _t_h_e _c_o_n_t_e_n_t_s _o_f _o_n_e _o_r _m_o_r_e _e_l_e_m_e_n_t_s _o_f _a_n _a_r_c_h_i_v_e

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

     This function creates an object which contains functions that are
     used in collecting the contents of elements in  an archive file. 
     We typically call this function with the names of the elements in
     the archive in which we   are interested.  This amounts to a
     filter. Then, as we iterate over the contents of the archive in a
     function such as 'tarExtract', at the start of each element  the
     callback/handler function is invoked and in the case of
     'collectContents', it either ignores the element if the name is
     not in this collection of ``target'' entries, or else it stores
     the contents of that entry  in a list using the entry name as the
     key. The results can be retrieved from the internal state of these
     functions using the '.ans' element of the list. By default, this
     returns the list of entry contents. Optionally, this function can
     be given a converter function which is  applied element-wise to
     the entry content list. And if a  list  of converter functions is
     passed,  then the function is applied to the  to the corresponding
     element of the entry contents list and the list returned.

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

     collectContents(entries)

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

 entries: character vector giving the (full) names of the entries in
          which we are interested.  If the names do not match,

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

     This returns an S3 object of class  'TarExtractCallback' and
     'TarCallback'. This identifies that the 'store' element can be
     used within  the tar iterator function 'tarExtract'. The second
     element '.ans' is a function that can be used to retrieve the
     results that are gathered during the different invocations to the
     'store' function.

_A_u_t_h_o_r(_s):

     Duncan Temple Lang

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

     'tarExtract'

