require (datasets)
data (iris)
d = splitdata (iris, 5)
pca = PCA (d$train.x)
# The coordinates of unseen observations on the axes of the training analysis
head (predict (pca, d$test.x))
# An observation of the training set projects onto the coordinates the analysis gave it
pca$ind$coord [1, ]
predict (pca, d$train.x [1, ])
Run the code above in your browser using DataLab