Skip to contents

Stores a weight array as an assay. Note that none of the built-in registered reducers currently consume custom weight assays: reduce() refuses weights = "custom" (and "n_eff") unless the selected reducer declares support for that scheme, rather than silently ignoring it.

Usage

attach_weight(g, name, array)

Arguments

g

A realised GDS

name

Assay-like name for the weights (e.g., "n_eff" or "w_custom")

array

Numeric 3D array matching sample x subject x contrast

Value

Updated GDS with weights stored in assays

Examples

beta <- array(0, dim = c(2,2,1)); var <- array(1, dim = c(2,2,1))
g <- new_gds(list(beta = beta, var = var), space_sample_labels(c("a","b")), c("s1","s2"), "c1")
w <- array(1, dim = c(2,2,1))
g2 <- attach_weight(g, "w_custom", w)