Project new data onto principal components from a fitted PCA model.
Usage
# S3 method for class 'stat_pca'
predict(object, newdata, retain = NULL, fold = FALSE, .collect = TRUE, ...)Arguments
- object
A
stat_pcaobject- newdata
A tibble with the same predictor columns as training data
- retain
How many PCs to return:
NULL(default): All PCsInteger (e.g.,
5): First N PCsNumeric 0-1 (e.g.,
0.95): PCs explaining this proportion of variance
- fold
How to return PC scores:
FALSE(default): Add as separate columns (PC1,PC2, ...)TRUE: Fold into single list-column named"pca"Character: Fold into single list-column with this name
- .collect
Logical. Should predictions be added to
newdata(TRUE, default) or returned as a standalone tibble (FALSE)?- ...
Additional arguments (reserved)
