apply_3d | R Documentation |
NA values will be removed automatically
apply_3d(
array,
dim = 3,
FUN = rowMeans2,
by = NULL,
scale = 1,
na.rm = TRUE,
...
)
array |
A 3d array |
dim |
giving the subscripts to split up data by. |
FUN |
function, should only be row applied function, e.g. |
by |
|
scale |
in the same length of |
apply_row matrixStats::rowRanges
set.seed(1)
size <- c(10, 8, 31)
arr <- array(rnorm(10 * 8 * 31), dim = size)
by <- c(rep(1, 10), rep(2, 21))
r2 <- apply_3d(arr, 3, by = by, FUN = rowMeans)
## Not run:
arr_yearly <- apply_3d(arr, by = year(dates), scale = days_in_month(dates))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.