Accepts either a spectral data frame (with Soil_ID + numeric
wavelength columns) plus a family from the model registry, OR a
raw matrix plus an explicit wavelength vector.
Usage
plot_mean_spectrum(
x,
wl = NULL,
family = NULL,
id_col = "Soil_ID",
xlab = NULL,
ylab = "Mean Response",
title = "Mean ± SD spectrum",
colour = "#2166ac"
)Arguments
- x
Either a data frame with
Soil_ID+ numeric spectral columns, OR a numeric matrix (rows = samples, cols = wavelengths). The legacy argument nameMis retained as an alias.- wl
Numeric vector of wavelength positions. Required when
xis a matrix; auto-detected whenxis a data frame.- family
Optional family list from
model_registry; when provided with a data frame, draws the model grid range as dashed vertical lines.- id_col
Sample identifier column name (default
"Soil_ID"); only used whenxis a data frame.- xlab
X-axis label; auto-detected when
NULL- ylab
Y-axis label (default
"Mean Response")- title
Plot title
- colour
Line/ribbon colour (default
"#2166ac")
