Description Usage Arguments Details Value Examples
mapnd() and reduce_dim() is not true map-reduce since mapnd() does not emit anything. However, these functions are designed to mimic the map-reduce paradigm in hope of facilitating a uniform data processing scheme for all objects.
1 2 3 | reduce_along(x, along, reduce_func = NULL, names = NULL, ...)
reduce_lastdim(x, reduce_func = NULL, names = NULL, ...)
|
x |
data to reduce. |
along |
axis/dimension to reduce. |
reduce_func |
a function to perform the reduction. |
names |
set names to results. |
... |
passed to reduce_func. |
reduce_lastdim() reduces x along last dimension, and it is a bit more efficient since no permutation is done to x.
a list
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
max_avg_current <- function(abf) {
abf %>%
samplend(ratio = 1000, func = "mean") %>%
reduce_lastdim(reduce_func = max)
}
plot_iv <- function(abf, intv) {
p <- abf[MaskIntv(intv),,] %>%
mapnd(func = "mean") %>%
reduce_lastdim(names = c("current", "voltage")) %>%
data.frame() %>%
ggplot(mapping = aes_string("current", "voltage"))
p + geom_line()
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.