plot_scoring_curves: Plot Scoring Curves for All Variables

View source: R/visualization.R

plot_scoring_curvesR Documentation

Plot Scoring Curves for All Variables

Description

Visualises the scoring function (0–1 transformation) for each variable in the configuration, overlaid on the observed data distribution. This plot is essential for verifying that the scoring configuration is biologically sensible before computing indices.

Usage

plot_scoring_curves(data, config, group_cols = "LandUse", ncol = 3)

Arguments

data

The raw (unscored) soil data frame.

config

A sqi_config object.

group_cols

Character vector of grouping columns to exclude.

ncol

Integer. Number of columns in the facet grid. Default 3.

Value

A ggplot object.

Examples

data(soil_data)
cfg <- make_config(
  variable = c("pH","EC","BD","OC","MBC","Clay"),
  type     = c("opt","less","less","more","more","opt"),
  opt_low  = c(6.0, NA, NA, NA, NA, 20),
  opt_high = c(7.0, NA, NA, NA, NA, 35)
)
plot_scoring_curves(soil_data, cfg,
                    group_cols = c("LandUse","Depth"))


SQIpro documentation built on April 20, 2026, 5:06 p.m.