Description Usage Arguments Value Author(s) See Also
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.
1 | collectContents(entries)
|
entries |
character vector giving the (full) names of the entries in which we are interested. If the names do not match, |
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.
Duncan Temple Lang
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.