Skip to contents

This function takes an array and a summary scheme and returns a vector of weighted means per group.

Usage

array_w_mean(array, scheme)

Arguments

array

to be summarised.

scheme

a dataframe containing the indices to average together with weights.

Value

A vector containing summary values per group, ordered by group.

Details

A summary scheme must contain 3 columns of array indices on rows, columns and slices, titled "x", "y", and "layer". A column named "group" defines the values to be summarised together. A column "weight" contains the weights for computing weighted mean. Helper functions are coming to help make common schemes.