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

secondary axis to ggbiplot R

I'd like to add a secondary set axes to ggbiplot; The points and the arrows have, in my case (and probably in many others), huge scale difference. I'd like the points to have one set x and y labels (say bottom(x) and left(y)) that will represent the…
Guy
  • 3,535
  • 2
  • 12
  • 9
0
votes
1 answer

R ggbiplot for PCA results: why is the resulting plot so narrow and how to adjust the width?

So I do a PCA analysis, and I usually plotted the results with ggplot2, but I just recently discovered ggbiplot which can show arrows with the variables. ggbiplot seems to be working ok, though it shows some problems (like the imposibility of…
DaniCee
  • 2,397
  • 6
  • 36
  • 59
0
votes
0 answers

How can I visualize Flexible Discrimant Analysis as a biplot in R?

I've read the paper of Gardner and Le Roux about Extensions of Biplot Methodology to Discriminant Analysis. I wanted to ask if someone got any practical experience with that method. I've got a FDA model for a data set from kaggle Human Resources…
sha
  • 1
  • 1
0
votes
0 answers

ggvis for PCA with vector loadings?

A few years back, Chitrasen managed to use ggvis for PCA - with the significantly higher interactivity available for ggvis I really want to use it going forward. However, I'm unable to locate any information outside of Chitrasen's code for making…
Scott
  • 311
  • 2
  • 13
0
votes
1 answer

Get PCA datapoints in R

I am using the following example to test my data in pca. I was hoping to extract the data points used to plot PCA scatter chart with ggbiplot function. I couldnt find anything in ggbiplot documentation, but maybe someone is aware of an alternative…
nlv
  • 791
  • 7
  • 28
0
votes
1 answer

Customize border of ggbiplot points

Given the following code using the ggbiplot library available via devtools::install.github() : library(ggbiplot) data(iris) log.ir <- log(iris[, 1:4]) ir.species <- iris[, 5] ir.pca <- prcomp(log.ir, center = TRUE, scale. = TRUE) g <-…
Julio Diaz
  • 9,067
  • 19
  • 55
  • 70
0
votes
1 answer

The first principal component has almost all the information, but it does not seem to be the best indicator for classification

I have a feature vector of 180 elements, and have applied a PCA on it. The problem is that the first pc has a high variance, but according to this biplot diagram for pc1 vs pc2, it seems that this is happening because of an outlier. Which is strange…
Hamed
  • 474
  • 5
  • 17
0
votes
0 answers

R: ggbiplot legend doesn't show different colours AND shapes

I admit this question has already been asked at least two times, but none of the provided answers worked for me. My data is very similar to the ggbiplot wine example, so I'll just use this to illustrate my problem. I want my datapoints to be…
Anca
  • 157
  • 3
  • 7
0
votes
2 answers

Problems with Shiny PCA and ggbiplot coloring

I've seen quite a few questions on StackOverflow about problems with aes mapping in Shiny, and most of these are solved with using aes_string() in people's code. These are almost exclusively to do with x/y values, though. My issue arises when using…
Scott
  • 311
  • 2
  • 13
0
votes
1 answer

R plotting PCA scores with ggbiplot

I'm trying to plot PCA scores using ggbiplot but I can't due to a mismatch between my scores and my groupings. I think the mismatch stems from the NA values in my original log-transformed data (which I omit when I calculate the PCs). Is there a way…
val
  • 1,629
  • 1
  • 30
  • 56
0
votes
0 answers

ggbilpot, How do I increase the factor label text size?

I am struggling to change the attributes in my biplot created in ggbiplot. I would like to increase size of the text at the end of my factor arrows (the red text). Can anyone help please? The code I have used is as follows. ma<-…
0
votes
1 answer

ggbiplot: how to maintain group colors after changing point size?

I am doing a PCA on plots in 2 habitat types in which I collected data on multiple environmental variables. I was able to change the colors of the points from the ggbiplot defaults. I want the size of each point to depend on canopy cover in that…
Emilio M. Bruna
  • 297
  • 1
  • 3
  • 14
0
votes
1 answer

change point colors and shapes in ggbiplot in r

I am using ggbiplot() and would like to manipulate the colors and shapes of the datapoints to make them more printer friendly. Currently I get the default rainbow of colors from ggbiplot(). I have tried using the arguments "+ scale_colour_discrete"…
Sarah L
  • 1
  • 1
  • 1
0
votes
1 answer

ggbiplot and biplot in base R producing two different biplots

ggbiplot and biplot in base R are producing two different biplots. Am I missing something here? Thanks in advance for your help. Code library(ggbiplot) p <- ggbiplot( prcomp(dat, scale. = FALSE) , obs.scale = 1 , var.scale = 1 , labels = …
MYaseen208
  • 22,666
  • 37
  • 165
  • 309
-1
votes
2 answers

ggbiplot worked previously with prcomp, now will not

ggbiplot used to work with no problems using prcomp but now does not. All I receive is the following error code: Error in plot_label(p = p, data = plot.data, label = label, label.label = label.label, : Unsupported class: prcomp I have…