I am creating a PCA biplot with multivariate data.
Is there a way to specify the colour/transparency/position of line segments in ggbiplot
? None of the arguments to this command provide this option.
I know ggbiplot
is based on ggplot
- does it perhaps accept aes
arguments? Or can one layer colour/transparency/position over the created plot to override defaults?
Specifically, regarding position, I would like to jitter the line segments if this is possible (although making them more transparent will probably solve the problem already).
Working example, using the iris
data:
#load required packages
library(ggplot2)
library(devtools)
library(ggbiplot)
#load dataset
data(iris)
#perform principal component analysis
pca = prcomp(iris[ , 1:4], scale=T)
#define classes, generate & view PCA biplot
class = iris$Species
ggbiplot(pca, obs.scale = 1, var.scale = 1, groups = class, circle = FALSE,
varname.size = 1, varname.adjust = 6)
Thanks very much - any help is appreciated!
Kind regards.