Index based weighted means from arrays in C++
array_w_mean.Rd
This function takes an array and a summary scheme and returns a vector of weighted means per group.
Arguments
- array
to be summarised.
- scheme
a dataframe containing the indices to average together with weights.
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.