The aim of this project was to make a simple to use customizable correlational biplot function, where R's default packages are used as much as possible. Principal components are scaled to unit variance. Now also includes a 3D biplot function.
library(devtools)
install_github("StefaanVerwimp/Biplot")
Or download the R files locally and load them in using the function:
# Choose r-files
source(choose.files())
The simplest biplot:
data(iris)
library(pca.biplot)
pca.biplot(iris[,-5])
With some customization:
pca.biplot(iris[,-5], scale = T, col = c("#00AFBB", "#E7B800", "#FC4E07"),
groups = iris$Species, ellipse = T, pch = 16, main = "Iris data biplot",
legend.pos = 'topright', circle.options = list(border = "grey"))
In 3D:
pca.biplot3d(iris[,-5], groups = iris$Species, scale = T, box = T, grid = T, ellipse = T)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.