reduce_cluster | R Documentation |
reduce_cluster()
and map_cluster()
apply the data reduction to the targets
found in the director step. They only do so if the metric is above the
threshold, however. reduce_cluster()
is for functions that return vectors
while map_cluster()
is for functions that return data.frames
. If you're
using as_reducer()
, there's no need to call these functions directly.
reduce_cluster(.partition_step, .f, first_match = FALSE)
map_cluster(.partition_step, .f, rewind = FALSE, first_match = FALSE)
.partition_step |
a |
.f |
a function to reduce the data to either a vector or a data.frame |
first_match |
logical. Should the partition algorithm stop when it finds
a reduction that is equal to the threshold? Default is |
rewind |
logical. Should the last target be used instead of the current target? |
a partition_step
object
reduce_row_means <- function(.partition_step, .data) {
reduce_cluster(.partition_step, rowMeans)
}
replace_partitioner(
part_icc,
reduce = reduce_row_means
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.