recursiveApply(X, FUN, ..., skip = F)
FUN
.
TRUE
then do not apply
FUN
to
X
itself.
This may be used to avoid infinite loops.
FUN
,
for
X
, its slots, its list elements, and its attributes.
There may be duplicates, e.g. for a matrix the
dim
attribute and
.Dim
slot are the same.
This function does not descend recursive objects,
such as functions and expressions.
Related functions include
lapply
, which handles only list elements,
and
rapply
, which is similar to
recursiveApply
except
does not allow
...
arguments, and currently
does not process attributes of non-list objects,
skips some slots (e.g. the
.Data
slot of some objects),
and does descend functions.
# Does any part of an object inherits from "miVariable"? any(unlist(recursiveApply(cholesterolImpExample, inherits, "miVariable"))) # Use get for a function with an unusual name recursiveApply(cholesterolImpExample, get("["), 1)