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
1
vote
2 answers

How to add circle around specific points in PCA produced by ggbiplot

I know how to produce a PCA plot through ggbiplot and this package works well. But now I want to modify some specific points, such as their color, size and especially adding circles around some points but not cover them by geom_encircle()…
花落思量错
  • 352
  • 1
  • 11
1
vote
1 answer

Remove ID sample of dots in PCA fviz_pca_biplot while keeping the labels on the vectors

I'm doing a PCA with the fviz_pca_biplot and would like to remove the ID of my dots to make the PCA clearer. I would like to keep my vectors label. What command should I use to remove the ID? Here's my code and the result. pca_biplot =…
Ocean
  • 11
  • 2
1
vote
1 answer

Removing sample IDs from PCA plot in ggbiplot, R

Is there any way to remove the sample IDs from a ggbiplot and instead add dots which represent each sample? I am using the script below, but have more data in my PCA and the IDs are currently making everything look messy, and dots or circles would…
Malin
  • 11
  • 2
1
vote
1 answer

can any one help on making pca biplot with circle and eclipse?

Example dataset: structure(list(Litter = c("Bottle caps & lids", "Bottles < 2 L", "Drink package rings, six-pack rings, ring carriers", "Food containers (fast food, cups, lunch boxes etc.)", "Plastic bags (opaque & clear)", "Cigarettes, butts &…
Kazi
  • 67
  • 7
1
vote
1 answer

R: ggbiplot - why can't I control the number of legend columns with guide_legend?

I use ggbiplot regularly and can control every aspect of the plot produced using ggplot2 tools, since it inherits from ggplot2... In ggplot2, I usually control the number of columns in the legend with a line of the…
DaniCee
  • 2,397
  • 6
  • 36
  • 59
1
vote
1 answer

How to change loading labels of biplot in r?

I am struggling with changing the loading labels of biplot. I used prcomp function to run PCA and ggbiplot. I've tried to change it with loading.label.label = c("a","b","c","d"), but it didn't work. I have attached my code and plot below. k <-…
1
vote
2 answers

R ggbiplot installation errer

I know this is a recurrent issue. However, going through all the hits when I google still has not helped me solve the issue. I hope someone can help: Her is what I do: 1: I run install.packages('devtools') library(devtools) This appears to run all…
SigneMaten
  • 493
  • 1
  • 6
  • 13
1
vote
0 answers

ggbiplot returning a blank red column

I have a microarray of 47,303 probes and 6 time points of treatment of samples. They are in a large matrix: dim(microarray) 47303 6 I've done the following: pca <- prcomp(x = t(microarray), scale. = T, center = T) Using ggplot2 I'm able to…
Anurag N. Sharma
  • 362
  • 2
  • 10
1
vote
1 answer

Custom legend order ggbiplot, built off ggplot2

I have created a PCA plot in using the ggbiplot() function, form the ggbiplot package, which is built on top of ggplot2. Here is an analogous, reproducible example: library(ggbiplot) data(wine) wine.pca <- prcomp(wine, scale. =…
colin
  • 2,606
  • 4
  • 27
  • 57
1
vote
0 answers

"Error in plot_label (p=p . . . Unsupported class: prcomp"

I see the same problem reported recently (March 24, 2019). Previously was able to use ggbiplot for prcomp object. Now I get the error shown below: Here is my code: > pca<-prcomp(data,center=TRUE,scale=TRUE) > library(ggbiplot) >…
tom_rwu
  • 41
  • 4
1
vote
2 answers

GGbiplot some additional color for some datapoints

Is it possible in ggbiplot package in R to mark some special data points like data point with Alcohol = 13.2 in another color then in the clusters. I want to highlight some specific data points. data(wine) wine.pca <- prcomp(wine, scale. =…
Bettina
  • 27
  • 7
1
vote
0 answers

R ggbiplot - How to change the axes scales according to length of loadings?

I performed a PCA analysis (on Iris data) using the R prcomp package. When I am plotting the results using the ggbiplot function, the scale of the axes is according to the rotated data (= ir_pca$x) (see picture link below), but I want the axes…
Frodus
  • 11
  • 3
1
vote
0 answers

Don't show points in ggbiplot

Using ggbiplot, how can I hide the points from the plot so that only the vectors are shown? I know I can modify the points by adding geom_point() but as it does not seem to be possible to plot geom_point() behind the ggbiplot() layer e.g. setting…
erc
  • 10,113
  • 11
  • 57
  • 88
1
vote
0 answers

How to color arrows in ggbiplot?

I am doing a PCR analysis and I was wondering if there is a possibility to colour the arrows based on some features? Like in my example, I would like to have half of the arrows colored in red (WT), and the other in blue (SHC). Is that possible? Or…
magruc
  • 165
  • 1
  • 11
1
vote
0 answers

Preventing ggplot2 from printing a vector in legend

I've used ggbiplot to produce a biplot. I want points of different colours for different factor levels and the size of points to represent sample size. The problem that's driving me nuts is that part of the size vector…
Pertinax
  • 417
  • 4
  • 17