Description Usage Arguments Details Value
This function applies a function to leaves of a nested list (depth-first) if and only if the
class of the leaf matches one of the names in class
.
1 2 3 4 |
l |
the list to be traversed. |
f |
the function to be applied to the leaves of the list. |
class |
a vector of class names (as quoted strings).
All and only objects inheriting from any of
these will be considered a leaf, even if they are also lists.
Any objects that are neither lists nor inherit from |
name |
a prefix for the names in the resulting list |
sep |
the separator to be used when creating the names of the leaves from the list nesting. |
strict.lists |
a logical. If |
is.parent |
a function of an item and item name that returns a logical indicating whether a node is a leaf. See the default vaule for examples. |
f
must be of the form f(item, item_name)
where
item
is a member of l
and
item_name
is the concatenated name of item
created
by applying sep
between node names in the list.
a flat, named list of the results of applying f
to the leaves of l
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.