loapply | R Documentation |
Specialised lapply
functions for R6 or other OOP classes.
This is simply a wrapper that detects if FUN
is a function, in which
case lapply
is used as usual, or a string, in which case the given
field/method is returned as a list.
loapply(X, FUN, ...)
X, ... |
See lapply |
FUN |
Either a function to apply to each element of |
## lapply as usual loapply(c(1, 2, 3), identity) ## For R6 objects objs <- list(ooplah$new(), ooplah$new()) # Public field loapply(objs, "oop") # Public method loapply(objs, "hello")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.