Questions tagged [ggbiplot]

A biplot based on ggplot2.

This tag refer to the library ggbiplot on github for the programming language. One can install it with:

library(devtools)
install_github("vqv/ggbiplot")

It allows to plot Principal Component Analysis using ggplot (see ).

107 questions
25
votes
2 answers

R: plotting posterior classification probabilities of a linear discriminant analysis in ggplot2

Using ggord one can make nice linear discriminant analysis ggplot2 biplots (cf chapter 11, Fig 11.5 in "Biplots in practice" by M. Greenacre), as…
Tom Wenseleers
  • 7,535
  • 7
  • 63
  • 103
23
votes
3 answers

Adding ellipses to a principal component analysis (PCA) plot

I am having trouble adding grouping variable ellipses on top of an individual site PCA factor plot which also includes PCA variable factor arrows. My code: prin_comp<-rda(data[,2:9], scale=TRUE) pca_scores<-scores(prin_comp) #sites=individual site…
Lew
  • 350
  • 1
  • 4
  • 11
19
votes
2 answers

R: add calibrated axes to PCA biplot in ggplot2

I am working on an ordination package using ggplot2. Right now I am constructing biplots in the traditional way, with loadings being represented with arrows. I would also be interested though to use calibrated axes and represent the loading axes as…
Tom Wenseleers
  • 7,535
  • 7
  • 63
  • 103
8
votes
1 answer

PCA Scaling with ggbiplot

I'm trying to plot a principal component analysis using prcomp and ggbiplot. I'm getting data values outside of the unit circle, and haven't been able to rescale the data prior to calling prcomp in such a way that I can constrain the data to the…
scs217
  • 2,218
  • 2
  • 17
  • 18
7
votes
1 answer

prcomp and ggbiplot: invalid 'rot' value

I'm trying to do a PCA analysis of my data using R, and I found this nice guide, using prcomp and ggbiplot. My data is two sample types with three biological replicates each (i.e. 6 rows) and around 20000 genes (i.e. variables). First, getting the…
erikfas
  • 4,357
  • 7
  • 28
  • 36
7
votes
2 answers

Principal Component Analysis in R data color

Hi everyone I have a simple question but for which i havent been able to get an answer in any tutorial. Ive done a simple principal component analysis on a set of data and then plot my data with biplot. CP <- prcomp(dat, scale. =…
5
votes
2 answers

Installing ggbiplot from github

I'm trying to install development version of ggbiplotfrom Github. During installation I'm getting the following error message: library(devtools) install_github("ggbiplot", "vqv") Installing github repo(s) ggbiplot/master from vqv Installing…
MYaseen208
  • 22,666
  • 37
  • 165
  • 309
5
votes
1 answer

ggbiplot - change the group color and marker

In the example ggbiplot script plot there are 3 groups, how can I change the marker colors and shapes? library(ggbiplot) data(wine) wine.pca <- prcomp(wine, scale. = TRUE) ggbiplot(wine.pca, obs.scale = 1, var.scale = 1, group=wine.class, …
lroca
  • 621
  • 2
  • 8
  • 19
4
votes
2 answers

package ‘ggbiplot’ is not available (for R version 3.5.3)?

Warning in install.packages : package ‘ggbiplot’ is not available (for R version 3.5.3) tried every options I found to install this package. is it not available to this version of R? have I other way to use ggbiplot on my RStudio?
Alvaro B
  • 63
  • 1
  • 1
  • 4
4
votes
1 answer

How to add ellipse center in ggbiplot?

I have data set seperated in 4 groups: groups = taxabylevel. I ran ggbiplot and add ellipses around each group. How to add centre of each ellipses? g <- ggbiplot(pca, obs.scale = 1, var.scale = 1, alpha=0, groups = taxaBylevel,show_guide = FALSE,…
Doro
  • 75
  • 5
4
votes
2 answers

Convex hulls with ggbiplot

Based on the help below I tried this script for plotting PCA with Convex hulls without success, any idea how can I solve it? library(ggbiplot) library(plyr) data <-read.csv("C:/Users/AAA.csv") my.pca <- prcomp(data[,1:9] , scale. =…
wrek
  • 309
  • 2
  • 13
3
votes
0 answers

"Error in `[.data.frame`(x, order(x, na.last = na.last, decreasing = decreasing)) : undefined columns selected" for ggbiplot for pca

I am performing principal components analysis on a dataset that I have. Here is the code that I have used thus far: pca1<-prcomp(data1,center=TRUE,scale=TRUE) summary(pca1) pca1$rotation pca1$sdev^2 library("devtools") library("ggbiplot") plot1 <-…
3
votes
1 answer

PCA plot with factoextra package. How do I change regular labels to sample names?

I've read similar questions about that here, but still didn't work for my problem. I have a table with: columns with different kinds of pollutants levels and a column with the name of the samples. However, in no way I can change the name of the…
Mari
  • 43
  • 1
  • 5
3
votes
1 answer

R: How to use ggbiplot with pcaRes object? plot PCA results of data with missing values

I usually perform Principal Component Analyses with the prcomp function, and plot the results in a fancy way with ggbiplot (or otherwise just with ggplot2 extracting pca.obj$x). Like…
DaniCee
  • 2,397
  • 6
  • 36
  • 59
3
votes
1 answer

ggbiplot - change the colour of labels

By default, the ggbiplot function gives a graph with loadings as red arrows and unit labels in black: library(ggbiplot) data("USArrests") us <- princomp(USArrests) ggbiplot(us, labels = rownames(us$scores)) is the result of that code How can I…
1
2 3 4 5 6 7 8