Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Has anybody had success installing ggbiplot under R 3.5.2 #53

Open
AntonioGPS opened this issue Jan 16, 2019 · 38 comments
Open

Has anybody had success installing ggbiplot under R 3.5.2 #53

AntonioGPS opened this issue Jan 16, 2019 · 38 comments

Comments

@AntonioGPS
Copy link

I've tried the experimental or not experimental versions of vqv, richardjtelford and vangalamaheshh github ggbiplot sites without success

@djgibson1
Copy link

I've the same problem downloading ggbiplot. Hoping for a solution here. Are there alternative ways of plotting the elipses and the circle?

@Potamophylax
Copy link

I had a problems with installation too!

@AntonioGPS
Copy link
Author

I was able to install the package with the option force= TRUE
But now, this is not working with any of the alternatives

@Potamophylax
Copy link

Potamophylax commented Jan 22, 2019

Very strange: now it works after R restarting! (R 3.5.2)
And after manual 'scales' instalation...

library(openxlsx)

library(reshape2)

library(plyr)

library(scales)

library(ggplot2)

library(devtools)

library(grid)

####################################### Works
install_github("vqv/ggbiplot")

library(ggbiplot)

@AntonioGPS
Copy link
Author

AntonioGPS commented Jan 23, 2019

Still not working for me with Potamophylax suggestion
It is surprising the kind of error it throws
"Error: package 'datasets' in options("defaultPackages") was not found

The datasets package is a base package, and cannot be either installed or updated

If I preload the datasets package, is not working either...

@AntonioGPS AntonioGPS changed the title Has anybody have success installing ggbiplot under R 3.5.2 Has anybody had success installing ggbiplot under R 3.5.2 Jan 24, 2019
@spookysounds
Copy link

Can confirm the non-experimental version installed successfully for me using the instructions from Readme.md.

@ghost
Copy link

ghost commented Apr 2, 2019

I had to use

install_github("vqv/ggbiplot", force = TRUE)

and not updating other packages.

@iago-pssjd
Copy link

I installed with the given instructions, checking before I had installed the packages quoted by Potamophylax and I had no problem, even to work, with R version 3.5.2 too.

@AntonioGPS
Copy link
Author

After fully updating my linux R, and having R version 3.5.3, I eventually could install ggbiplot by using

library(devtools)
install_github("vqv/ggbiplot", force = TRUE)

@fernandosarossi
Copy link

fernandosarossi commented Aug 1, 2019

Use this command to install, for new versions of R:

install.packages("remotes")
remotes::install_github("vqv/ggbiplot")

@meenakshi-kushwaha
Copy link

Thanks for this @fernandosarossi .

@Sobia803
Copy link

Hi,

I am having issue in installing ggbiplot via githubinstall in R 3.6.1. The error it is giving is pasted below:

library(usethis)
library(devtools)
install_github("vqv/ggbiplot")
Downloading GitHub repo vqv/ggbiplot@master
Installing 1 packages: pkgconfig
Installing package into ‘\uniwa.uwa.edu.au/userhome/students5/21583685/My Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)

There is a binary version available but the source version is later:
binary source needs_compilation
pkgconfig 2.0.2 2.0.3 FALSE

installing the source package ‘pkgconfig’

trying URL 'https://cloud.r-project.org/src/contrib/pkgconfig_2.0.3.tar.gz'
Content type 'application/x-gzip' length 6080 bytes
downloaded 6080 bytes

'\uniwa.uwa.edu.au\userhome\students5\21583685\My Documents'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
ERROR: failed to lock directory '\uniwa.uwa.edu.au/userhome/students5/21583685/My Documents/R/win-library/3.6' for modifying
Try removing '\uniwa.uwa.edu.au/userhome/students5/21583685/My Documents/R/win-library/3.6/00LOCK-pkgconfig'
Error: Failed to install 'ggbiplot' from GitHub:
(converted from warning) installation of package ‘pkgconfig’ had non-zero exit status

@pnaveen4u87
Copy link

After fully updating my linux R, and having R version 3.5.3, I eventually could install ggbiplot by using

library(devtools)
install_github("vqv/ggbiplot", force = TRUE)

It worked for me thanks.

@EOKELLO
Copy link

EOKELLO commented Oct 30, 2019

you can do this without the ggbiplot
for example
biplot(mtcars.pca) it works

@JOSEPHINEGEND
Copy link

you can do this without the ggbiplot
for example
biplot(mtcars.pca) it works

This worked for me on R version 3.6.1.
Thanks.

@karenvbeaman
Copy link

Has anyone installed ggbiplot under R 3.6.0.? I can't get it to work on my new computer.

I've tried both of these suggestions:
install_github("vqv/ggbiplot", force = TRUE)

install.packages("remotes")
remotes::install_github("vqv/ggbiplot")

Here are the messages I get:

Installing package into ‘C:/Users/KarenV/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)

  • installing source package 'ggbiplot' ...
    ** using staged installation
    ** R
    ** data
    ** byte-compile and prepare package for lazy loading
    Error: (converted from warning) package 'ggplot2' was built under R version 3.6.1
    Execution halted
    ERROR: lazy loading failed for package 'ggbiplot'
  • removing 'C:/Users/KarenV/Documents/R/win-library/3.6/ggbiplot'

Any suggestions would be most helpful.

@AntonioGPS
Copy link
Author

this is the most disgusting package to install. After updating R to 3.6.1, there is not an easy way to install the package. I am facing the same problems again, and the methods herein described are not working again

@AntonioGPS
Copy link
Author

you can do this without the ggbiplot
for example
biplot(mtcars.pca) it works

This worked for me on R version 3.6.1.
Thanks.

But this is not ggbiplot. biplot is the regular function that does not use the nice graphics implemented into ggplot2

@8ar10der
Copy link

8ar10der commented Feb 3, 2020

After fully updating my linux R, and having R version 3.5.3, I eventually could install ggbiplot by using

library(devtools)
install_github("vqv/ggbiplot", force = TRUE)

Not work for me

library(devtools)
install_github("vqv/ggbiplot", force = TRUE)
Downloading GitHub repo vqv/ggbiplot@master
Error in utils::download.file(url, path, method = download_method(), quiet = quiet, :
URL'https://api.github.com/repos/vqv/ggbiplot/tarball/master'

@karenvbeaman
Copy link

karenvbeaman commented Feb 3, 2020 via email

@8ar10der
Copy link

8ar10der commented Feb 3, 2020

After fully updating my linux R, and having R version 3.5.3, I eventually could install ggbiplot by using

library(devtools)
install_github("vqv/ggbiplot", force = TRUE)

Not work for me

library(devtools)
install_github("vqv/ggbiplot", force = TRUE)
Downloading GitHub repo vqv/ggbiplot@master
Error in utils::download.file(url, path, method = download_method(), quiet = quiet, :
URL'https://api.github.com/repos/vqv/ggbiplot/tarball/master'

I solved the issues with this commands

library(devtools)
options(download.file.method = "wininet")
install_github("vqv/ggbiplot", force = TRUE)

I hope that may help anybody

@karenvbeaman
Copy link

karenvbeaman commented Feb 4, 2020 via email

@ILVOddeconinck
Copy link

Hey guys! My colleague was also struggling with this so I helped him figure it out.

You don't need to get functions from packages for them to work. You can entre them manually.

What I suggested he did is to go to https://github.com/vqv/ggbiplot
and download the zip file ("clone or download"). In the zip file you'll find a folder called R. In this folder are two R scripts.
Open these two and just run them.
This is the manual way of creatin gthe function ggbiplot.

Hopefully I explained it well enough.

Kind regards!
Dumas

@karenvbeaman
Copy link

karenvbeaman commented Feb 7, 2020 via email

@Attia81
Copy link

Attia81 commented Mar 21, 2020

As Dumas suggested, just use the two functions there

source("path to /ggbiplot-master/R/ggbiplot.r")
source("path to /ggbiplot-master/R/ggscreeplot.r")

@sahemo
Copy link

sahemo commented Apr 1, 2020

To add with @ILVOddeconinck and @Attia81 ,

source('https://raw.githubusercontent.com/vqv/ggbiplot/master/R/ggbiplot.r')

source('https://raw.githubusercontent.com/vqv/ggbiplot/master/R/ggscreeplot.r')

pca_object <- prcomp(iris[,-5], center = T, scale. = T)

ggbiplot(pca_object)

ggscreeplot(pca_object)

Created on 2020-04-01 by the reprex package (v0.3.0)

@salix-d
Copy link

salix-d commented Apr 3, 2020

Very strange: now it works after R restarting! (R 3.5.2)
And after manual 'scales' instalation...

library(openxlsx)

library(reshape2)

library(plyr)

library(scales)

library(ggplot2)

library(devtools)

library(grid)

####################################### Works
install_github("vqv/ggbiplot")

library(ggbiplot)

Pretty normal since when you do : library(ggbiplot)
you get

Loading required package: ggplot2
Loading required package: plyr
Loading required package: scales
Loading required package: grid

so it does need it. Altho, I guess it could ask you to install it explicitly since it's a dependency...

Only problem I got installing it with remotes::install_github("vqv/ggbiplot") was that it ask me to update packages and doing so gives me an error saying it can't remove the previous install of those package. So I have to close R, delete the package manually in it's folder, and redo the install ignoring the updates. Don't know if that error is related tho, because it does that for all packages I install using remotes.

(Installing on R 3.6.3)

@ribschenato
Copy link

Use this command to install, for new versions of R:

install.packages("remotes")
remotes::install_github("vqv/ggbiplot")

This solution proposed by @fernandosarossi still working under R-4.0.2

@ghost
Copy link

ghost commented Sep 3, 2020

Use this command to install, for new versions of R:

install.packages("remotes")
remotes::install_github("vqv/ggbiplot")

Thank you, it works for me.

@GangminLigithub
Copy link

The source file appeared in tar.gz. is ther any windows version?

@Guilhembp
Copy link

Hi all,

I downloaded the functions and loaded them into my script, worked nicely.
But still, am a bit sceptical about the way it works, as the exemple provided on the GitHub platform where I took the functions are not working.

Let say i have my dateframe "my_data" which as on factor with three levels (groups) and 4 response variables (numerical).
the function 'prcomp' will only take numercial object. So, to use it i need to write the following:

PCA_results = prcomp(my_data[,-1], center = T, scale = T)

Then, when I use ggbiplot, I want to color my points by their respective groups. But since ggbiplot takes only prcomp objects, and that my object PCA_results contains only the scores of the PCA, and no grouping factor, I can't group anything.

The exemple given by the creators of the function is the following:
wine.pca <- prcomp(wine, scale. = TRUE)
ggbiplot(wine.pca, obs.scale = 1, var.scale = 1,
groups = wine.class, ellipse = TRUE, circle = TRUE) +
scale_color_discrete(name = '') +
theme(legend.direction = 'horizontal', legend.position = 'top')

So for me, when copying exactly this code, I get an error back saying prcomp can't use the object wine (not numercial only), and when correcting it, then it says that wine.classe does not exist.

I m not a fan of this package at all. So far I managed to make a biplot using ggplot only, but I am trying to figure a way to have the eigendvectors on the graph too. Any idea how to do it?
by adding a geom_segment() maybe?

thanks for your help !

@row2x
Copy link

row2x commented Oct 21, 2020

When you instantiate the wine data, it also creates a separate list of Factors called wine.class. I have used prcomp/ggbiplot on my own data. First, remove any Factors from your original dataframe to run PCA, and then create a separate vector with a Factor and assign to the parameter 'groups'.

The library example works fine for me under R3.6.3:
library(ggbiplot)
data(wine) # Verify with str(wine) and str(wine.class)
wine.pca <- prcomp(wine, scale. = TRUE)
ggbiplot(wine.pca, obs.scale = 1, var.scale = 1,
groups = wine.class, ellipse = TRUE, circle = TRUE) +
scale_color_discrete(name = '') +
theme(legend.direction = 'horizontal', legend.position = 'top')

Good luck

@Guilhembp
Copy link

Guilhembp commented Oct 21, 2020 via email

@ougahi2020
Copy link

I successfully installed ggbiplot by running this command first,
Sys.setenv(R_REMOTES_NO_ERRORS_FROM_WARNINGS="true")
then install from
remotes::install_github("vqv/ggbiplot")

@Pratiksha-ui
Copy link

Use this command to install, for new versions of R:

install.packages("remotes")
remotes::install_github("vqv/ggbiplot")

This solution proposed by @fernandosarossi still working under R-4.0.2

Thanks a lot!! It's Working for me.

@sahemo
Copy link

sahemo commented Feb 20, 2024 via email

@sarathsp06
Copy link

Did you get any notification for this PR now ? I did

@Attia81
Copy link

Attia81 commented Feb 20, 2024 via email

Repository owner deleted a comment from boloboloda Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests