Skip to contents

Builds a feature matrix on the fixed 700-bin grid of Zacharias (2013): 300 bins covering 6.5-9.5 ppm + 400 bins covering 0.5-4.5 ppm, both at 0.01 ppm width. The water region (4.5-6.5 ppm) is excluded. Bins are ordered high-to-low — column 1 covers (9.49, 9.50) ppm, column 700 covers (0.50, 0.51) ppm.

Suitable as the feat_fun argument of fit_mdm(). Per-spectrum dispatch:

  • If lcpar is empty (raw spectra): bin $si directly.

  • If lcpar is non-empty (deconvoluted / aligned spectra): reconstruct si_hat = lorentz_sup(cs, lcpar) on the spectrum's own cs grid using x0al when present (else x0), then bin the reconstruction.

Always returns all 700 columns; maxCombine, igrs and peakPos are accepted for feat_fun protocol compatibility but ignored (the bin layout is hardcoded).

Usage

bin700(x, maxCombine = 0L, igrs = list(), peakPos = NULL, ...)

Arguments

x

A spectra, decons2, or aligns object.

maxCombine

Ignored. Accepted for protocol compatibility.

igrs

Ignored. Accepted for protocol compatibility.

peakPos

Ignored. Accepted for protocol compatibility.

...

Ignored.

Value

A numeric matrix with one row per spectrum and 700 columns of bin sums. Column names are sprintf("%.4f", bin_midpoint); row names are spectrum names.

Author

2026 Tobias Schmidt: initial version.

Examples

# `sim` spans only ~3.3-3.6 ppm, so most of the 700 fixed bins are 0.
X <- bin700(sim[1:3])