Learn R Programming

detrendr (version 0.1.0)

pillar-stats: Get the means/medians/variances of pillars of a 3d array.

Description

For a 3-dimensional array mat3d, pillar ij is defined as mat3d[i, j, ]. These functions compute the mean, median and variance of each pillar.

Usage

mean_pillars(arr3d, parallel = FALSE)

median_pillars(arr3d, parallel = FALSE)

var_pillars(arr3d, parallel = FALSE)

Arguments

arr3d

A 3-dimensional array.

parallel

Do you want to parallelize the computation across multiple cores? If so, set this to the number of cores that you would like to use, or set it to TRUE to use all available cores.

Value

A matrix where element i,j is equal to mean(mat3d[i, j, ]), median(mat3d[i, j, ]), or var(mat3d[i, j, ]).

Examples

Run this code
# NOT RUN {
aaa <- array(1:16, dim = c(2, 2, 4))
mean_pillars(aaa)
median_pillars(aaa)
var_pillars(aaa)

# }

Run the code above in your browser using DataLab