Streams a subset of observations through the PCA rotation and plots their scores on the requested components. Sampling keeps the drawn subset small so graphics remain interpretable even when the source big matrix contains millions of rows.
pca_plot_scores(
x,
rotation,
center = numeric(),
scale = numeric(),
components = c(1L, 2L),
max_points = 5000L,
sample = c("uniform", "head"),
seed = NULL,
draw = TRUE,
...
)A list containing indices (the sampled row indices) and scores
(the corresponding score matrix) is returned invisibly. When draw = TRUE
a scatter plot is produced.
Either a bigmemory::big.matrix, a standard matrix, or a data
frame.
A rotation matrix such as pca_result$rotation.
Optional centering vector. Use numeric() when no centering
was applied.
Optional scaling vector. Use numeric() when no scaling was
applied.
Length-two integer vector selecting the principal components to display.
Maximum number of observations to sample for the plot.
Strategy for selecting rows. "uniform" draws a random sample
without replacement, whereas "head" takes the first max_points rows.
Optional seed to make the sampling reproducible.
Logical; set to FALSE to skip plotting and only return the
sampled scores.
Additional graphical parameters forwarded to plot().