View source: R/visualization.R
| plot_scores | R Documentation |
Displays a heatmap of mean variable scores (0–1) per group, allowing rapid visual identification of which variables drive high or low SQI within each land-use system.
plot_scores(
scored,
config,
group_cols = "LandUse",
group_by = group_cols[1],
facet_by = NULL,
palette = "RdYlGn",
title = "Mean Variable Scores by Group"
)
scored |
A scored data frame from |
config |
A |
group_cols |
Character vector. Grouping columns. |
group_by |
Character. Which grouping column to display on the x-axis. |
facet_by |
Character or |
palette |
Character. Colour palette: |
title |
Character. Plot title. |
A ggplot object.
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)
)
scored <- score_all(soil_data, cfg, group_cols = c("LandUse","Depth"))
plot_scores(scored, cfg, group_cols = c("LandUse","Depth"),
group_by = "LandUse", facet_by = "Depth")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.