ilap: Iterate over sequence length of input and return list(s)
Usage
ilap(.data, .f, ...)
Arguments
.data
Object representing the sequence length, used as ".i" in the .f
expression. If matrix or data frame, sequence length will be determined by
the number of columns. If integer, then it will be passed directly onto
function call, otherwise the object will be converted into a sequence from
1 to the length of the object.
.f
Function to apply to each element (as an integer position) of input
object. This can be written as a single function name e.g., mean, a
formula-like function call where '.i' is assumed to be the integer position
of input data object e.g., ~ mean(mtcars[[.i]]), or an in-line
function definition e.g., function(x) mean(mtcars[[x]]).
# NOT RUN {## return string listilap(1:10, ~ paste0(letters[.i], rev(LETTERS)[.i]))
## return list of columnsilap(mtcars, ~ c(row.names(mtcars)[.i], mtcars$wt[.i]))
# }