Entering edit mode
6.2 years ago
demoraesdiogo2017
▴
110
Hello I have used the following code to generate a PCA graph of my data
library(ggplot2)
pca.data <- data.frame(Sample=rownames(pca$x),
X=pca$x[,1],
Y=pca$x[,2])
pca.data
ggplot(data=pca.data, aes(x=X, y=Y, label=Sample)) +
geom_text() +
xlab(paste("PC1 - ", pca.var.per[1], "%", sep="")) +
ylab(paste("PC2 - ", pca.var.per[2], "%", sep="")) +
theme_bw() +
ggtitle("Cancer studies PCA")
But was unable to add ellipses to it. Most tutorials I have seem have used ggbiplot for ellipses, and for some reason I'm unable to download this package (it says it doesn't exist).
What can I do?
Are you sure it says the package doesn’t exist, or just isn’t available for your R version etc?
How are you trying to install ggplot2? Could you also post the results of
sessionInfo()
?You can just install the development version straight from GitHub:
.
.