Skip to contents

Generic counterpart to matrixStats::colMeans2(). Methods are provided for delarr objects, but packages can extend the generic for their own delayed types.

Usage

colMeans2(x, ...)

Arguments

x

An object for which row means should be computed.

...

Additional arguments passed to methods.

Value

Typically a numeric vector of column means.

Examples

mat <- matrix(1:12, nrow = 3, ncol = 4)
darr <- delarr(mat)

# Compute column means lazily
colMeans2(darr)
#> [1]  2  5  8 11

# Compare with base R
colMeans(mat)
#> [1]  2  5  8 11