Description Usage Arguments Examples
Apply a Function to List Elements at Given Index
1 | apply_at_index(x, i, fun, ..., prefix = NULL)
|
x |
a list or a data frame (which is in fact a list) |
i |
vector of indices of elements in |
fun |
function to be applied |
... |
further arguments passed to |
prefix |
optional. String used to prefix the names of the elements to
which the function was applied. By default the name of the function
|
1 2 3 4 5 | (x <- list(a = 1, b = 2, c = 3))
fhpredict:::apply_at_index(x, i = -1, fun = exp)
(x <- data.frame(a = -(1:2), b = -(2:3), c = c("a", "b")))
fhpredict:::apply_at_index(x, i = -3, fun = abs)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.