array_w_mean: Index based weighted means from arrays in C++

View source: R/RcppExports.R

array_w_meanR Documentation

Index based weighted means from arrays in C++

Description

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.

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.

Value

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


Jack-H-Laverick/nemomedusR documentation built on Dec. 12, 2022, 5:21 a.m.