condense {DecomposeR} | R Documentation |
Condenses columns of matrix
Description
Condenses columns of a matrix by averaging or summing them. The condensing can be done partially: a multiple of the repetitions can be averaged or summed to keep some repetitions.
Usage
condense(m, n, fun = "mean")
Arguments
m |
matrix of repeated signal, each column being a repetition |
n |
the number of repetitions that will be averaged/summed |
fun |
the function to apply to each repetition: "mean" or "sum". |
Value
a matrix with n times less columns
Examples
m <- matrix(rep(seq(100, 800, 100), each = 10) + rep(1:10, 8), ncol = 8)
m
condense(m, 4)
[Package DecomposeR version 1.0.6 Index]