Skip to contents

Internal helper used by add_lmf to build the censored-flag side table consumed by compute_lmf_for_sample (Issue 5: give non-detects detection-limit-scale uncertainty instead of a fixed RSD). A collapsed total (total_N_, total_alk_) is censored only if every present constituent species was a non-detect.

Usage

collapse_censored(df_meq, id_cols)

Arguments

df_meq

Long-format dataframe with columns analyte, detected, plus any columns named in id_cols.

id_cols

Character vector of column names to preserve as row identifiers during the wide pivot.

Value

Wide-format tibble of logicals, one row per unique combination of id_cols, one column per collapsed panel ion.