Why is the ggplot2 installation failing? - r

I'm trying to install the ggplot2 package, so that I make use of ggplot function for my graphs but it keeps failing me. Where is the problem?
> install.packages("ggplot2")
Installing package into ‘C:/Users/Augustinho/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
ggplot2 3.3.0 3.3.1 FALSE
installing the source package ‘ggplot2’
trying URL 'https://cran.stat.unipd.it/src/contrib/ggplot2_3.3.1.tar.gz'
Content type 'application/octet-stream' length 3035612 bytes (2.9 MB)
downloaded 2.9 MB
* installing *source* package 'ggplot2' ...
** package 'ggplot2' successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error : .onLoad failed in loadNamespace() for 'pillar', details:
call: utils::packageVersion("vctrs")
error: package 'vctrs' not found
ERROR: lazy loading failed for package 'ggplot2'
* removing 'C:/Users/Augustinho/Documents/R/win-library/3.5/ggplot2'
In R CMD INSTALL
The downloaded source packages are in
‘C:\Users\Augustinho\AppData\Local\Temp\RtmpM7MaYn\downloaded_packages’
Warning messages:
1: In readRDS(dest) : lzma decoding result 10
2: In install.packages("ggplot2") :
installation of package ‘ggplot2’ had non-zero exit status
> library(ggplot2)
Error in library(ggplot2) : there is no package called ‘ggplot2’

As you are on Windows, try to install the binary version with dependencies:
install.packages("ggplot2",
type = "binary",
dependencies = TRUE,
repos = "https://cloud.r-project.org")
Edit:
Helped first running:
install.packages("vctrs", type = "binary", dependencies = TRUE, repos = "https://cloud.r-project.org")
to skip some vctrs installation error.

Related

Getting an error message when installing psych package

The message I get:
Installing psych:
Installing package into 'C:/.../Documents/R/win-library/4.0'
(as 'lib' is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
psych 2.1.9 2.2.3 FALSE
installing the source package 'psych'
trying URL 'https://cran.rstudio.com/src/contrib/psych_2.2.3.tar.gz'
Content type 'application/x-gzip' length 1928530 bytes (1.8 MB)
==================================================
downloaded 1.8 MB
* installing *source* package 'psych' ...
** package 'psych' successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error: unexpected symbol in "tools:::makeLazyLoading("psych", 'C:..."
Execution halted
ERROR: lazy loading failed for package 'psych'
* removing '.../Documents/R/win-library/4.0/psych'
The downloaded source packages are in
'C:...Temp\Rtmpe405Ws\downloaded_packages'
<U+2714> Package 'psych' successfully installed.
Warning message:
In utils::install.packages("psych", repos = "https://cran.rstudio.com/") :
installation of package 'psych' had non-zero exit status

asbio package in R 3.5.3 Error : object 'hcl.colors' is not exported by 'namespace:grDevices' ERROR: lazy loading failed for package 'asbio'

What's happen with asbio instalation here in R-3.5.3? Please.
There is a binary version available but the source version is later:
binary source needs_compilation
asbio 1.6-1 1.7 FALSE
installing the source package ‘asbio’
tentando a URL 'https://cran.csiro.au/src/contrib/asbio_1.7.tar.gz'Hi
Content type 'application/x-gzip' length 1789938 bytes (1.7 MB)
downloaded 1.7 MB
* installing *source* package 'asbio' ...
** package 'asbio' successfully unpacked and MD5 sums checked
** R
** data
** inst
** byte-compile and prepare package for lazy loading
Error : object 'hcl.colors' is not exported by 'namespace:grDevices'
ERROR: lazy loading failed for package 'asbio'
* removing 'C:/Program Files/R/R-3.5.3/library/asbio'
* restoring previous 'C:/Program Files/R/R-3.5.3/library/asbio'
In R CMD INSTALL
The downloaded source packages are in
‘C:\Users\rivad\AppData\Local\Temp\RtmpchxkNb\downloaded_packages’
Warning message:
In install.packages(NULL, .libPaths()[1L], dependencies = NA, type = type) :
installation of package ‘asbio’ had non-zero exit status
Thank you

Errors lazy loading failed for package 'devtools'

im trying to install DEVTOOLS but i keep getting the error showing . can any one assist please. The 2 errors as showing below
error 1:package usethis was built under R version 4.0.5
Error in loadNamespace
error 2:ERROR: lazy loading failed for package devtools
Here is my code
install.packages("blockmodeling", dependencies = TRUE)
install.packages("devtools", dependencies = TRUE)
library(devtools)
devtools::install_github("aslez/concoR")
install.packages("blockmodeling", dependencies = TRUE)
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/eslam/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/blockmodeling_1.0.0.zip'
Content type 'application/zip' length 410411 bytes (400 KB)
downloaded 400 KB
package ‘blockmodeling’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\eslam\AppData\Local\Temp\Rtmp6nB24u\downloaded_packages
> install.packages("devtools", dependencies = TRUE)
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/eslam/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
also installing the dependency ‘pkgload’
There are binary versions available but the source versions are later:
binary source needs_compilation
pkgload 1.2.0 1.2.1 TRUE
devtools 2.3.2 2.4.0 FALSE
Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/pkgload_1.2.0.zip'
Content type 'application/zip' length 151933 bytes (148 KB)
downloaded 148 KB
package ‘pkgload’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\eslam\AppData\Local\Temp\Rtmp6nB24u\downloaded_packages
installing the source package ‘devtools’
trying URL 'https://cran.rstudio.com/src/contrib/devtools_2.4.0.tar.gz'
Content type 'application/x-gzip' length 369987 bytes (361 KB)
downloaded 361 KB
* installing *source* package 'devtools' ...
** package 'devtools' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Warning message:
package 'usethis' was built under R version 4.0.5
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'pkgload' 1.2.0 is being loaded, but >= 1.2.1 is required
Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace
Execution halted
> ERROR
: lazy loading failed for package 'devtools'
* removing 'C:/Users/eslam/Documents/R/win-library/4.0/devtools'
Warning in install.packages :
installation of package ‘devtools’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\eslam\AppData\Local\Temp\Rtmp6nB24u\downloaded_packages’
> library(devtools)
Error in library(devtools) : there is no package called ‘devtools’
> devtools::install_github("aslez/concoR")
Error in loadNamespace(name) : there is no package called ‘devtools’
Thanks everyone for the support.
i figured it out . i had to run
install.packages("devtools,type="win.binary")

Not able to install RWeka

I am facing issues while installing the RWeka package. I tried installing rJava but even that is not being installed, can someone help here with the issue? You can follow the code for the error message
> install.packages("RWeka")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/1911120/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
RWeka 0.4-42 0.4-43 FALSE
installing the source package ‘RWeka’
trying URL 'https://cran.rstudio.com/src/contrib/RWeka_0.4-43.tar.gz'
Content type 'application/x-gzip' length 451318 bytes (440 KB)
downloaded 440 KB
* installing *source* package 'RWeka' ...
** package 'RWeka' successfully unpacked and MD5 sums checked
** using staged installation
**********************************************
WARNING: this package has a configure script
It probably needs manual configuration
**********************************************
** R
** inst
** byte-compile and prepare package for lazy loading
Error: .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
Execution halted
ERROR: lazy loading failed for package 'RWeka'
* removing 'C:/Users/1911120/Documents/R/win-library/3.6/RWeka'
Warning in install.packages :
installation of package ‘RWeka’ had non-zero exit status

unable to download ggplot 2 as 'lib' is unspecified

I had no problem installing and running ggplot2 in the past, but all of a sudden R studio can't find the ggplot2 package anymore. I tried reinstalling the package but although the console ran the code and "downloaded" the package, library(ggplot2) gives me an error:
Error in library(ggplot2) : there is no package called ‘ggplot2’
I already tried:
install.packages("ggplot2",
repos = c("http://rstudio.org/_packages",
"http://cran.rstudio.com"))
I also tried:
install.packages("ggplot2", dependencies = TRUE)
I also uninstalled and reinstalled Rstudio, ran it as admin but nothing works
this is what the console show when running the command
install.packages("ggplot2")
The console output is as follows:
Installing package into ‘C:/Users/Keith/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
also installing the dependency ‘rlang’
There are binary versions available but the source versions are later:
binary source needs_compilation
rlang 0.2.0 0.3.1 TRUE
ggplot2 2.2.1 3.1.0 FALSE
Binaries will be installed
trying URL
'https://cran.rstudio.com/bin/windows/contrib/3.3/rlang_0.2.0.zip'
Content type 'application/zip' length 754726 bytes (737 KB)
downloaded 737 KB
package ‘rlang’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Keith\AppData\Local\Temp\RtmpmKus85\downloaded_packages
installing the source package ‘ggplot2’
trying URL 'https://cran.rstudio.com/src/contrib/ggplot2_3.1.0.tar.gz'
Content type 'application/x-gzip' length 2863109 bytes (2.7 MB)
downloaded 2.7 MB
* installing *source* package 'ggplot2' ...
** package 'ggplot2' successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck
= vI[[j]]) :
namespace 'rlang' 0.2.0 is being loaded, but >= 0.2.1 is required
ERROR: lazy loading failed for package 'ggplot2'
* removing 'C:/Users/Keith/Documents/R/win-library/3.3/ggplot2'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l
"C:\Users\Keith\Documents\R\win-library\3.3"
C:\User\Keith\AppData\Local\Temp\RtmpmKus85/downlaoaded_packages/ggplot2_3.1.0.tar.gz' had status 1
Warning in installed.packages:
installation of package 'ggplot2' had non-zero exit status

Resources