View source: R/2_ggproto_visualize.r
plot_pca | R Documentation |
Performs PCA on the data and used proto_default
to plot with percent
variation labels.
plot_pca(data, components = c(1, 2), ...)
data |
Numeric matrix or data.frame of the observations. |
components |
The 2 numbers of the principal components to use. |
... |
Optionally pass arguments to |
proto_default()
dat <- scale_sd(wine[, 2:6])
plot_pca(data = dat)
## Different components, class coloring
clas <- as.factor(wine$Type)
plot_pca(data = dat, components = c(1, 3), position = "center",
aes_args = list(color = clas, shape = clas))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.