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
0
votes
1 answer

How to add circle on ggbiplot plot using geom_encircle from ggalt package?

Recently, I used ggbiplot package to draw the PCA plot. For better visualization, I also added geom_encircle to get circle region on the PCA result. How, the problem I met is I don't know how to get the mapping color consistently. I tried several…
花落思量错
  • 352
  • 1
  • 11
0
votes
1 answer

ggplot(): Unable to add text to a PCA biplot with geom_text() in R

Issue I have produced a PCA biplot using the packages ggbiplot/ggplot2. I have rescaled and lengthened the loadings (arrows) using the function geom_segment(). I used the argument var.axes = FALSE to remove the shorter loadings (arrows) because my…
Alice Hobbs
  • 1,021
  • 1
  • 15
  • 31
0
votes
0 answers

ggplot2/ggbiplot: PCA Biplot Arrow length using geom_segment() and label adjustment with geom_label() in R

Issue: I have been struggling with rescaling the loadings (arrows) length in a ggplot2/ggbiplot in a PCA biplot. I have researched extensively through StackOverflow, on the web, and I've asked the R Studio Community to resolve my issue, although,…
Alice Hobbs
  • 1,021
  • 1
  • 15
  • 31
0
votes
2 answers

ggbiplot(): How to change the colour of the arrows and text using a function for a PCA biplot in R

Issue I have used the function ggbiplot() to produce a PCA biplot for multivariate data (see diagram 1 - below) I found this Stackoverflow post for specifying the colour/transparency/position of line segments in ggbiplot. Therefore, I am trying to…
Alice Hobbs
  • 1,021
  • 1
  • 15
  • 31
0
votes
1 answer

Resizing ggbiplot plots

I am looking for ways to reconfigure ggbiplot plots to match each other. I know that plots are scaled differently to 'fit' the data behind the plot but I wondered if anyone has any advice on how to make plots match. I used ggarange to make this…
0
votes
1 answer

Font change in ggplot not working on biplot label names

I have stumbled upon a problem, where I can change all the text in a biplot image to the another font, with the exception of labels. A simple example of the problem is seen below, with label text clearly differing: Code that I used is also…
Ales Kolma
  • 27
  • 4
0
votes
1 answer

Trying to remove the gridlines and background in a PCA using ggbiplot in R

I have made a PCA in R using ggbiplot(PCA.model,ellipse=TRUE,labels=PCA_data $label,groups=PCA_data$Month) [image of PCA][1] but i need to remove the grey and the gridlines. I have tried solutions on here but nothing has worked so far. I have…
0
votes
1 answer

How to add/assign color to many groups automatically

I need some help to modify my R script that could assign different color to each group. I always need to specify color name/code manually [e.g., scale_fill_manual(values = c("grey", "red", "yellow", "green"))]. Complete R script is here …
karadeniz
  • 5
  • 2
0
votes
2 answers

PCA : Can I reverse the axis of the first principal component in R?

Here is a reproducible example : set.seed(10) pick <- sample(nrow(iris),nrow(iris)/2) iris.training <- iris[pick,] iris.testing <- iris[-pick,] pca.training <- prcomp(iris.training[-5]) pca.testing <-…
outofthegreen
  • 352
  • 1
  • 13
0
votes
1 answer

Is there a simple way to plot a multiple bar graph using iplot?

I have a dataset that looks like this, and I need to use the location as the color, the words as the x axis. country good amazing best Aus 12 45 12 Fiji 25 5 23 USA 45 5 12 UK …
Mtrinidad
  • 157
  • 1
  • 11
0
votes
0 answers

Problems installing vqv/ggbiplot

I was able to install successfully library(devtools), but when trying to install: install_github("vqv/ggbiplot") Downloading GitHub repo vqv/ggbiplot@master Error in utils::download.file(url, path, method = method, quiet = quiet, : cannot open…
0
votes
1 answer

Principal component analyis

I measured different plant traits and enviromental factors like radiaton or temperature for 42 different genotypes. I want to know which traits are related to each other and which traits are influenced to each other (e.g. radiation to trait). Thus a…
David
  • 39
  • 6
0
votes
1 answer

Cannot install devtools package on mac

I would like to use the ggbiplot function in R. I tried to install the devtools package first, but it doesn´t work. I am using R studio Version 1.2.1335 and have a mac with version 10.14.5 Tried different types of…
Theresa M.
  • 77
  • 1
  • 7
0
votes
1 answer

How can I remove arrows from ggbiplot of PCA in R that are not significant?

So, I am attempting to create a ggbiplot of a PCA of prey order in the diet of diurnal and nocturnal raptors, but the problem is that the ggbiplot function automatically creates arrows for each order. There are only about 8 orders that are…
0
votes
0 answers

Error when I try and use ggbiplot from the library github

I am trying to use the plotting function ggbiplot using this code: install.packages("devtools") library(devtools) install_github("vqv/ggbiplot") g <- ggbiplot(iris.pca, obs.scale = 1, var.scale = 1, groups = iris[,5], ellipse =…