# MinutePlot validation -- PCA (iris)
# Install once: nothing -- this script uses base R only

# Versions (compare against those stated on this page):
cat(R.version.string, "\n")

# Load data:
d <- iris[, 1:4]                 # built-in; or: d <- read.csv("iris.csv")[, 1:4]

# Analysis (one print per table shown on the page, in page order):
p <- prcomp(d, scale. = TRUE)
print(summary(p))
print(round(p$rotation, 4))
print(round(head(p$x, 3), 4))
