View source: R/visualizations.R
pcaplot | R Documentation |
Plot a PCA object returned by prcomp
pcaplot(
pca,
components = 1:2,
group = NULL,
col = NULL,
pch = 19,
cex = 2,
legend = NULL,
...
)
pca |
PCA object returned by prcomp |
components |
a vector of length two indicating the components to plot |
group |
a factor determining shapes of the points to show (unless overriden by pch=...) |
col |
Color for plotting (default: internal palette) |
pch |
Type of character to plot (default: 19) |
cex |
size of the symbols used for plotting |
legend |
draw a legend? If legend is a position (eg. "topright"), then a legend is drawn. If NULL or if the group parameter is NULL, then not. |
... |
any further parameters will be passed to the plot() function (e.g. col, cex, ...) |
This is a simplistic function. A much better way is to use the pca2d function from the pca3d package.
If group is NULL, then NULL; else a data frame containing colors and shapes matching each group
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.