| lapplI {labelmachine} | R Documentation |
Improve lapply and sapply with index
Description
Improve base::lapply() and base::sapply() functions by allowing
an extra index argument .I to be passed into the function given in FUN.
If the function given in FUN has an argument .I then, for each entry
of X passed into FUN the corresponding index is passed into
argument .I. If the function given in FUN has no argument .I,
then lapplI and sapplI are exactly the same as
base::lapply() and base::sapply().
Besides this extra feature, there is no difference to base::lapply() and
base::sapply().
Usage
lapplI(X, FUN, ...)
sapplI(X, FUN, ..., simplify = TRUE, USE.NAMES = TRUE)
Arguments
X |
a vector (atomic or list) or an |
FUN |
Here comes the great difference to |
... |
optional arguments to |
simplify |
logical or character string; should the result be
simplified to a vector, matrix or higher dimensional array if
possible? For |
USE.NAMES |
logical; if |