Issues installing and loading packages

Hi everyone.

This is my first time posting, so please forgive me if something should have been done differently.
I've tried to use the reprex function, but it will not work for me.

It's been a few years since I last used R studios, but I ned to do a PCA analysis and plot for my thesis im handing in, in 6 days!
I've downloaded the newest version of R and RStudios
I've tried installing all the packages I usually use, and are experiencing issues with many packages.

The package I really need is ggbiplot. I can understand that many are experiencing issues with this, so I have been searching for a way to fix this for 4 days, and have tried the following methods for installing:

remotes::install_github('vqv/ggbiplot')
Yes
install.packages("remotes")
remotes::install_github('vqv/ggbiplot')
Yes
Sys.setenv(R_REMOTES_NO_ERRORS_FROM_WARNINGS="true")
install_github('vqv/ggbiplot', force=TRUE)

AND

install.packages('devtools')
yes
devtools::install_github('mortenarendt/data4consumerscience')
yes
devtools::install_github('vqv/ggbiplot')

None works. I'm desperate at this point.

I'm running the code:
install.packages('devtools')
library("devtools")
install_github('vqv/ggbiplot')

the error I'm receiving when I attempt to install the package is this:

install.packages("devtools")
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/devtools_2.4.5.tgz'
Content type 'application/x-gzip' length 422160 bytes (412 KB)
==================================================
downloaded 412 KB

The downloaded binary packages are in
/var/folders/rp/0f53kg9n6f5gkfpc1bgg16640000gn/T//RtmpPIgxQq/downloaded_packages

library("devtools")
Loading required package: usethis
install_github('vqv/ggbiplot')
Downloading GitHub repo vqv/ggbiplot@HEAD
Installing 1 packages: tibble

There is a binary version available but the source version is later:
binary source needs_compilation
tibble 3.1.8 3.2.0 TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) Yes
installing the source package ‘tibble’

trying URL 'https://cran.rstudio.com/src/contrib/tibble_3.2.0.tar.gz'
Content type 'application/x-gzip' length 565955 bytes (552 KB)

downloaded 552 KB

  • installing source package ‘tibble’ ...
    ** package ‘tibble’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    ERROR: compilation failed for package ‘tibble’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/tibble’

The downloaded source packages are in
‘/private/var/folders/rp/0f53kg9n6f5gkfpc1bgg16640000gn/T/RtmpPIgxQq/downloaded_packages’
── R CMD build ───────────────────────────────────────────────────────────────────
:heavy_check_mark: checking for file ‘/private/var/folders/rp/0f53kg9n6f5gkfpc1bgg16640000gn/T/RtmpPIgxQq/remotes1ea64dc1678b/vqv-ggbiplot-7325e88/DESCRIPTION’
─ preparing ‘ggbiplot’:
:heavy_check_mark: checking DESCRIPTION meta-information
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ looking to see if a ‘data/datalist’ file should be added
─ building ‘ggbiplot_0.55.tar.gz’

  • installing source package ‘ggbiplot’ ...
    ** using staged installation
    ** R
    ** data
    ** byte-compile and prepare package for lazy loading
    Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
    there is no package called ‘tibble’
    Execution halted
    ERROR: lazy loading failed for package ‘ggbiplot’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/ggbiplot’
    Warning messages:
    1: In i.p(...) : installation of package ‘tibble’ had non-zero exit status
    2: In i.p(...) :
    installation of package ‘/var/folders/rp/0f53kg9n6f5gkfpc1bgg16640000gn/T//RtmpPIgxQq/file1ea64cf447f3/ggbiplot_0.55.tar.gz’ had non-zero exit status

I'm getting the sense that the path on my computer makes it so that the package can't be found. But I have no idea about computers, nd how to change it.
can anyone help?

I have also tried using the remote package, but am getting a similar error

I was able to install it on Posit Cloud (formerly RStudio Cloud) using remotes::install_github("vqv/ggbiplot")

It is version 0.55 from 2011-10-23

Good luck!

Thank you so much for your reply. However, I have tried this already, and it also gives the same error

Have you tried installing at R level?

I opened a terminal window, loaded R and successfully down laded it with

remotes::install_github("vqv/ggbiplot")

I just created a brand new project in Posit Cloud, installed the tidyverse and remotes as I always do, and then successfully installed ggbiplot using remotes.

remotes::install_github("vqv/ggbiplot")
Downloading GitHub repo vqv/ggbiplot@HEAD
Installing 2 packages: Rcpp, plyr
Installing packages into ‘/cloud/lib/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
trying URL 'http://rspm/default/__linux__/focal/latest/src/contrib/Rcpp_1.0.10.tar.gz'
Content type 'application/x-gzip' length 2134651 bytes (2.0 MB)
==================================================
downloaded 2.0 MB

trying URL 'http://rspm/default/__linux__/focal/latest/src/contrib/plyr_1.8.8.tar.gz'
Content type 'application/x-gzip' length 817977 bytes (798 KB)
==================================================
downloaded 798 KB

* installing *binary* package ‘Rcpp’ ...
* DONE (Rcpp)
* installing *binary* package ‘plyr’ ...
* DONE (plyr)

The downloaded source packages are in
	‘/tmp/RtmpeqFZWK/downloaded_packages’
Running `R CMD build`...
* checking for file ‘/tmp/RtmpeqFZWK/remotese83d5fd990/vqv-ggbiplot-7325e88/DESCRIPTION’ ... OK
* preparing ‘ggbiplot’:
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* looking to see if a ‘data/datalist’ file should be added
* building ‘ggbiplot_0.55.tar.gz’
Installing package into ‘/cloud/lib/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
* installing *source* package ‘ggbiplot’ ...
** using staged installation
** R
** data
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (ggbiplot)

Thank you so much for the suggestion, however, I still get the same error when I code directly in R:

remotes::install_github("vqv/ggbiplot")
Downloading GitHub repo vqv/ggbiplot@HEAD
tar: Failed to set default locale
tar: Failed to set default locale
Installing 1 packages: tibble

There is a binary version available but the source version is later:
binary source needs_compilation
tibble 3.1.8 3.2.0 TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) Yes
installing the source package 'tibble'

trying URL 'https://cloud.r-project.org/src/contrib/tibble_3.2.0.tar.gz'
Content type 'application/x-gzip' length 565955 bytes (552 KB)

downloaded 552 KB

During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C"
2: Setting LC_TIME failed, using "C"
3: Setting LC_MESSAGES failed, using "C"
4: Setting LC_MONETARY failed, using "C"

  • installing source package 'tibble' ...
    ** package 'tibble' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    ERROR: compilation failed for package 'tibble'
  • removing '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/tibble'

The downloaded source packages are in
'/private/var/folders/rp/0f53kg9n6f5gkfpc1bgg16640000gn/T/Rtmp8eiFix/downloaded_packages'
-- R CMD build ----------------------------------------------------------------

  • preparing 'ggbiplot':rivate/var/folders/rp/0f53kg9n6f5gkfpc1bgg16640000gn/T/Rtmp8eiFix/remotes1fcc398eb803/vqv-ggbiplot-7325e88/DESCRIPTION' ...
    checking DESCRIPTION meta-information ...
    During startup - Warning messages:
    1: Setting LC_CTYPE failed, using "C"
    2: Setting LC_TIME failed, using "C"
    3: Setting LC_MESSAGES failed, using "C"
    4: Setting LC_MONETARY failed, using "C"
  • installing source package 'ggbiplot' ...
    ** using staged installation
    ** R
    ** data
    ** byte-compile and prepare package for lazy loading
    During startup - Warning messages:
    1: Setting LC_CTYPE failed, using "C"
    2: Setting LC_TIME failed, using "C"
    3: Setting LC_MESSAGES failed, using "C"
    4: Setting LC_MONETARY failed, using "C"
    Error: package or namespace load failed for 'ggplot2' in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
    there is no package called 'tibble'
    Execution halted
    ERROR: lazy loading failed for package 'ggbiplot'
  • removing '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/ggbiplot'
    There were 50 or more warnings (use warnings() to see the first 50)

Can you supply us with the output of

sessionInfo()

If you are on a mac see

Thank you so much! I've not heard of posit cloud before. I'm trying it now, ind it seems to be downloading the packages. However, it will not load the package using the library() function, should another function be used to load the package?

When asked if you want to install from source, say no. The slightly older binary version should work just fine. It looks like there is a problem with your Command Line Tools for compiling source code.

Thank you so much! I think this is what solved my issue!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.