Description Usage Arguments Details Value Examples
#' The innerApply function applies a function to an atomic vector using two of its elements in sequence as inputs. It is different from purrr::accumulate since it does not use any of its output as an input.
1 | innerApply(input, .f0, distance = 1)
|
input |
An atomic vector. |
.f0 |
A function. Anonymous functions are supported. Formula or vectors are not. |
distance |
The distance between each element of the vector. The default value is 1. |
If the function used as .f0 returns a vector of length higher than 1, the function will throw an error.
An atomic vector of length equals length(input)-distance.
1 2 3 4 5 6 7 | inputVec <- 1:30
outputVec <- innerApply(inputVec, `+`)
innerApply(letters, paste0)
innerApply(c(TRUE,FALSE,TRUE,FALSE), `!=`)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.