Why won't ggplot install properly on my machine after an upgrade? - r

I've had a problem for a while now in which I can't load the stringi package until I install it clean. This seems to work as long as I'm in a single R session. Then, some time later, maybe when I create a new session or probably after a longer delay, I have to install it again.
This all broke this morning for some reason. Now, if I can install it straight away, and load it, but it's not recognized by ggplot2. Specifically when I try to install ggplot2 I get:
> library(stringi)
> install.packages("ggplot2")
Installing package into ‘/home/bensmith/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/ggplot2_3.0.0.tar.gz'
Content type 'application/x-gzip' length 2847050 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 dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/bensmith/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/libs/Rcpp.so':
/home/bensmith/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/libs/Rcpp.so: undefined symbol: R_ContinueUnwind
ERROR: lazy loading failed for package ‘ggplot2’
* removing ‘/home/bensmith/R/x86_64-pc-linux-gnu-library/3.4/ggplot2’
* restoring previous ‘/home/bensmith/R/x86_64-pc-linux-gnu-library/3.4/ggplot2’
Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpEStEk4/downloaded_packages’
As you can see, stringi loads successfully into the environment, but I get this error when installing ggplot2.
Elsewhere this problem has been reported as fixed by installing stringi, but here, that doesn't help. But I suspect something is wrong with the stringi installation because of the previous problems I have had having to continually reinstall it.
I have tried installing stringi and ggplot2 using
install.packages("stringi", type = "source")
install.packages("ggplot2", type = "source")
Once again, stringi installs but ggplot2 does not.

Seems to be installing Rcpp again that fixed the problem.
Thanks to commenter at https://community.rstudio.com/t/stringi-installation-not-recognized-consequently-ggplot-wont-install/11590

Related

Unable to install Tidyverse. Broom issues

Whenever I try to install tidyverse in R v 3.6.2
I receive the following error message:
Installing package into ‘C:/Users/daeb/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
also installing the dependency ‘broom’
There is a binary version available but the source version is later:
binary source needs_compilation
broom 0.5.3 0.5.4 FALSE
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/tidyverse_1.3.0.zip'
Content type 'application/zip' length 440101 bytes (429 KB)
downloaded 429 KB
package ‘tidyverse’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\daeb\AppData\Local\Temp\RtmpuWXq4I\downloaded_packages
installing the source package ‘broom’
trying URL 'https://cran.rstudio.com/src/contrib/broom_0.5.4.tar.gz'
Content type 'application/x-gzip' length 1228129 bytes (1.2 MB)
downloaded 1.2 MB
* installing *source* package 'broom' ...
** package 'broom' 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
Fejl i loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called 'zeallot'
Kald: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Kørsel stoppet
ERROR: lazy loading failed for package 'broom'
* removing 'C:/Users/daeb/Documents/R/win-library/3.6/broom'
Warning in install.packages :
installation of package ‘broom’ had non-zero exit status
I have tried reinstalling both R and Rstudio but it does not solve the problem. I tried installing Rtools, but it does not work either. It appears I have to solve the source/binary issue with broom but I do not know how.
As #hplieninger suggests, the proximal problem is that the installation of broom is looking for the zeallot package, which isn't installed:
there is no package called 'zeallot'
You should try manually installing the zeallot package (install.packages("zeallot")) and then try installing tidyverse again.
It might also help to say "no" when R asks you whether you want to install the packages with more recent source-code versions from source rather than binary. (The worst thing that can happen is that you end up with slightly older versions of some packages.)
However it's surprising that this requirement comes up. Are you using install.packages("tidyverse")? Are you specifying something like dependencies=TRUE?
Because according to the CRAN index pages
The current version of broom (0.5.4, apparently the same version that R is trying to install for you) doesn't directly import zeallot: it Depends only on R and
Imports: backports, dplyr, generics (≥ 0.0.2), methods, nlme, purrr, reshape2, stringr, tibble, tidyr
The current version of zeallot shouldn't obviously be needed. The packages that use it are:
Reverse imports: completejourney, graphTweets, ipumsr, keras, mlflow, statsExpressions
Reverse suggests: listarrays, SDMtune, vctrs

Different version of GlobalOptions package in R

I'm trying to install the package "circlize" and I am having trouble resolving what seems to be a simple error.
When I run:
install.packages("circlize")
It says:
Installing package into ‘*file location*/3.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependency ‘GlobalOptions’ is not available
There is a binary version available but the source version is later:
binary source needs_compilation
circlize 0.3.10 0.4.3 FALSE
installing the source package ‘circlize’
trying URL 'https://mirrors.sorengard.com/cran/src/contrib/circlize_0.4.3.tar.gz'
Content type 'application/x-gzip' length 2456906 bytes (2.3 MB)
downloaded 2.3 MB
* installing *source* package 'circlize' ...
** package 'circlize' successfully unpacked and MD5 sums checked
** R
** demo
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'GlobalOptions' 0.0.11 is being loaded, but >= 0.0.12 is required
ERROR: lazy loading failed for package 'circlize'
* removing '*file location*/3.2/circlize'
Warning in install.packages :
running command '"*file location*/x64/R" CMD INSTALL -l "*file location*\3.2" *file location*/downloaded_packages/circlize_0.4.3.tar.gz' had status 1
Warning in install.packages :
installation of package ‘circlize’ had non-zero exit status
The downloaded source packages are in
‘*file location*\downloaded_packages’
These parts seem most relevant to me:
dependency ‘GlobalOptions’ is not available
namespace 'GlobalOptions' 0.0.11 is being loaded, but >= 0.0.12 is required
When I run sessionInfo() I see under "other attached packages": [1] GlobalOptions_0.0.11
My best guess is that I have the wrong version of GlobalOptions -- I see that GlobalOptions v0.0.13 is available here, but being new to R, I'm not sure what to do now to get the right version up and running.
I'd really appreciate if someone could tell me where I should look next. (I looked through the documentation within that link, but I'm still lost about what to do now.) Thanks!
If you have R version >=3.3.0 you should
install GlobalOptions_0.0.13 from CRAN
install.packages("GlobalOptions")
quit and restart R
re-install circlize from source as before.
If you have an older R version, update R to a more recent version first.

unable to install packages("caret") completely in R version 3.2.3

> require("caret")
Loading required package: caret
Loading required package: lattice
Loading required package: ggplot2
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘pbkrtest’
So I found that there is lack of "pbkrtest" then I tried to reinstall it.
> install.packages("pbkrtest")
Installing package into ‘C:/Users/ADMIN/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is
later:
binary source needs_compilation
pbkrtest 0.4-2 0.4-3 FALSE
installing the source package ‘pbkrtest’
trying URL 'https://rweb.crmda.ku.edu/cran/src/contrib/pbkrtest_0.4- 3.tar.gz'
Content type 'application/x-gzip' length 164415 bytes (160 KB)
downloaded 160 KB
* installing *source* package 'pbkrtest' ...
** package 'pbkrtest' successfully unpacked and MD5 sums checked
** R
** data
** inst
** preparing package for lazy loading
Warning: replacing previous import by 'stats::sigma' when loading 'pbkrtest'
Error : object 'sigma' is not exported by 'namespace:stats'
ERROR: lazy loading failed for package 'pbkrtest'
* removing 'C:/Users/ADMIN/Documents/R/win-library/3.2/pbkrtest'
The downloaded source packages are in
‘C:\Users\ADMIN\AppData\Local\Temp\Rtmpk7mJT0\downloaded_packages’
Warning messages:
1: running command '"D:/R-3.2.3/bin/x64/R" CMD INSTALL -l
"C:\Users\ADMIN\Documents\R\win-library\3.2"
C:\Users\ADMIN\AppData\Local\Temp\Rtmpk7mJT0/downloaded_packages/pbkrtest_0.4- 3.tar.gz' had status 1
2: In install.packages("pbkrtest") :
installation of package ‘pbkrtest’ had non-zero exit status
It seems like that the installation keeps failing.
As a result, I couldn't use other code using caret packages.
I faced this problem as well on Windows 7. I did following steps in the sequence and it worked.
a) Make sure your R version is updated latest R release 3.2.3
b) The default sources seems to be installing Unix version. So I manually downloaded https://cran.r-project.org/web/packages/pbkrtest/index.html for windows
c) Use manually install function from R menu to install the package.
Cheers,
Ratan
Check version of R by typing version in your console.
If version is not "version.string R version 3.3.2" or later then
Install new version of R from https://cran.r-project.org/bin/windows/base/
Update R version using Tools => Global Options in RStudio.
install package using "install.packages("caret")" in your console.
do require(caret).
test using ?createDataPartition.

Installing packages in R: installing "mediation" fails despite dependencies being up-to-date

I am trying to install the mediation package. However, this fails due to lacking dependencies:
> install.packages("mediation")
Installing package into ‘/home/simoncolumbus/R/i686-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/mediation_4.4.4.tar.gz'
Content type 'application/x-gzip' length 1463736 bytes (1.4 Mb)
opened URL
==================================================
downloaded 1.4 Mb
* installing *source* package ‘mediation’ ...
** package ‘mediation’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** demo
** inst
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace ‘lattice’ 0.20-24 is already loaded, but >= 0.20.27 is required
Error : package ‘sandwich’ could not be loaded
ERROR: lazy loading failed for package ‘mediation’
* removing ‘/home/simoncolumbus/R/i686-pc-linux-gnu-library/3.0/mediation’
Warning in install.packages :
installation of package ‘mediation’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpWpmJqS/downloaded_packages’
This is somewhat surprising, because both lattice and sandwich, as well as zoo (which calls lattice) are up to date:
> installed.packages()
lattice "lattice" "/home/simoncolumbus/R/i686-pc-linux-gnu-library/3.0" "0.20-31" "recommended"
sandwich "sandwich" "/home/simoncolumbus/R/i686-pc-linux-gnu-library/3.0" "2.3-3" NA
zoo "zoo" "/home/simoncolumbus/R/i686-pc-linux-gnu-library/3.0" "1.7-12" NA
I've tried unloading the packages, updating them, installing them via the package manager - nothing seems to have an impact, though. Any suggestions?
Edit: Fixed the problem by updating to the latest available version of R; must be some incompatibility with the old version I was running that caused this.
Exit R. Delete the .Rdata file. Restart. The .Rdata file is able to hold and load packages.

R.oo package won't install on RStudio Server

I'm perplexed that the R.oo package installation fails on RStudio server, any idea on how I can get around it?
Installing package(s) into ‘/home/rstudio/R/library’
(as ‘lib’ is unspecified)
trying URL 'http://ftp.heanet.ie/mirrors/cran.r-project.org/src/contrib/R.oo_1.9.3.tar.gz'
Content type 'application/x-gzip' length 372217 bytes (363 Kb)
opened URL
==================================================
downloaded 363 Kb
* installing *source* package ‘R.oo’ ...
** package ‘R.oo’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
Error in match(el, set, 0L) : object 'R.KEYWORDS' not found
Error : unable to load R code in package ‘R.oo’
ERROR: lazy loading failed for package ‘R.oo’
* removing ‘/home/rstudio/R/library/R.oo’
Warning in install.packages :
installation of package ‘R.oo’ had non-zero exit status
According to the author of the R.oo and R.KEYWORDS packages, there was an incompatibility between the last version of R.KEYWORDS (v1.4.2) and R.oo (the cran version 1.9.3 was incompatible, not being the last one v1.9.8). He corrected that recently.
As of last night: I can confirm this problem on two different RStudio servers, one running R.2.14.1, the other R.2.15.1, so it's not R version. One is our linux server, the other is an amazon EC2 server. And no problem installing on a local RStudio (OSX; R.2.15.0).
HOWEVER: as of an hour ago, this problem has disappeared. On both RStudio Servers, R.oo now installs fine. So, try again!

Resources