Principal component analysis (PCA)

MinutePlot® and R on the same data. MinutePlot version 1.0.0; R 4.5.2.

Dataset

  • iris — Sepal and petal length and width of 150 iris flowers of three species (R: datasets::iris; Fisher 1936).
  • Data file (the same format serves MinutePlot and R): iris.csv — one column per variable; paste it into the app, and keep it in the R script’s folder.
  • R built-in: the script uses iris.

Setup

In MinutePlot:

  • Workbench → PCA → paste iris.csv → Preview datafirst column is sample names UNticked → group column ticked for Species → Confirm → components 4, Scale variables ticked (the default) → Run PCA.
  • The four numeric columns are the variables. Ticking first column is sample names on this file would consume Sepal.Length as labels and leave three variables — different numbers.

In R:

  • Base R only; then run iris_pca.R top to bottom (source it, or paste it into the console) with the R data file in the same folder.
  • R 4.5.2 and the package versions in the page header; each script prints the versions it runs under.

The analysis:

  • PCA of the four measurements, variables standardised (scale = TRUE; R: prcomp(scale. = TRUE)), all 150 flowers.
  • Signs of components are arbitrary; each R component is sign-aligned to MinutePlot’s before comparison.

Side-by-side results

Variance explained (%)

MinutePlot®

PC1PC2PC3PC4
72.96222.8513.6690.518

R

PC1PC2PC3PC4
72.96222.8513.6690.518

R values: verified in R 4.5.2 (see the verdict).

Loadings

MinutePlot®

VariablePC1PC2PC3PC4
Sepal.Length0.52110.37740.7196-0.2613
Sepal.Width-0.26930.9233-0.24440.1235
Petal.Length0.58040.0245-0.14210.8014
Petal.Width0.56490.0669-0.6343-0.5236

R

VariablePC1PC2PC3PC4
Sepal.Length0.52110.37740.7196-0.2613
Sepal.Width-0.26930.9233-0.24440.1235
Petal.Length0.58040.0245-0.14210.8014
Petal.Width0.56490.0669-0.6343-0.5236

R values: verified in R 4.5.2 (see the verdict).

First three scores

MinutePlot®

SamplePC1PC2
setosa 1-2.25710.4784
setosa 2-2.0740-0.6719
setosa 3-2.3563-0.3408

R

SamplePC1PC2
setosa 1-2.25710.4784
setosa 2-2.0740-0.6719
setosa 3-2.3563-0.3408

R values: verified in R 4.5.2 (see the verdict).

Verdict

Variance explained (72.96 / 22.85 / 3.67 / 0.52 %), loadings and the first scores agree with R’s printed prcomp output up to the arbitrary sign of PC2 and PC4 (aligned here); no letters in this entry.

R script

iris_pca.R — each script loads its data, prints its versions and the R-side tables shown above, in page order; no plotting.

R values verified in R 4.5.2 (emmeans 2.0.4, multcomp 1.4-32, multcompView 0.1-12, ez 4.5.0, Hmisc 5.3.0, pls 2.9.0, drc 3.0-1, car 3.1-5) on 16–17 September 2026.