View source: R/visualization.R
| plot_pca_biplot | R Documentation |
Renders a PCA biplot showing both variable loadings and group centroids,
using factoextra::fviz_pca_biplot. Useful for understanding
variable relationships and group separation underlying MDS selection.
plot_pca_biplot(
mds,
scored,
group_col = "LandUse",
title = "PCA Biplot of Soil Quality Variables"
)
mds |
An object returned by |
scored |
A scored data frame (for group colour coding). |
group_col |
Character. Column for group colours. |
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"))
mds <- select_mds(scored, group_cols = c("LandUse","Depth"))
plot_pca_biplot(mds, scored, group_col = "LandUse")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.