cellWeights: Compute per-cell contamination weights

View source: R/cellwise_utils.R

cellWeightsR Documentation

Compute per-cell contamination weights

Description

For each continuous column, standardize by median and MAD, then apply a robust weight function (Huber or Tukey bisquare) to obtain a weight in [0, 1] per cell. Categorical (factor, character, logical) columns receive weight 1.

Usage

cellWeights(X, method = "huber", alpha = NULL)

Arguments

X

a data frame or matrix of dimension n \times p

method

weight function: "huber" or "tukey", Default: "huber"

alpha

tuning constant. If NULL, the default for the chosen method is used (1.345 for Huber, 4.685 for Tukey).

Value

an n \times p numeric matrix of weights

Author(s)

Matthias Templ


VIM documentation built on Sept. 2, 2026, 5:07 p.m.