1

I've just installed DSX Desktop with RStudio. I'm unable to load new packages, e.g. lubridate, and get the error below. If I check for package updates, I get the message "all packages are up-to-date", but the error below suggests it needs a newer version of Rcpp.

installing to /user-home/_global_/R/lubridate/libs
** 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 ‘Rcpp’ 0.12.9.2 is already loaded, but >= 0.12.13 is required
ERROR: lazy loading failed for package ‘lubridate’
* removing ‘/user-home/_global_/R/lubridate’
Warning in install.packages :
  installation of package ‘lubridate’ had non-zero exit status

The downloaded source packages are in
  ‘/tmp/RtmpIV4HWl/downloaded_packages’

I tried install.packages("Rcpp") which returned the message:

Error in unloadNamespace(pkg_name) : 
  namespace ‘Rcpp’ is imported by ‘httpuv’, ‘reshape2’, ‘tidyr’, ‘bindrcpp’, ‘tibble’, ‘htmltools’, ‘dplyr’, ‘plyr’ so cannot be unloaded

If I try remove.packages("Rcpp") or removing the packages above, I get the following message, and they remain in the Packages view.

Removing package from ‘/user-home/_global_/R’
(as ‘lib’ is unspecified)
Error in remove.packages : there is no package called ‘Rcpp’

Any advice please on how to proceed?

Carl
  • 4,232
  • 2
  • 12
  • 24

2 Answers2

0

There seems to be a fundamental problem with RStudio. I encountered exactly the same problems you describe with the latest version (1.1.442). The problems are:

  1. Packages viewed as out-of-date go into a loop when installing with a repeated error dialog box appearing.
  2. The package version check refers out-of-date packages and will not install the current package versions showing on CRAN. This is due to RStudio pointing at a MRAN mirror that has old updates. This means that all packages stored there are out of date. You can see when the packages on MRAN were last updated here.
  3. Removal of other packages (e.g. dependencies) doesn't work properly, and manual deletion of the folders doesn't solve the problem.

Inside Tools, Global options, Packages there is the ability to specify the mirror that should be used for package management. This doesn't seem to work.

I fixed my problem by going into R and performing a package update inside that. RStudio now uses the updated packages.

I have contacted RStudio about this and received the reply that they don't provide support for free versions of RStudio.

tl;dr: RStudio appears to be broken for updating packages. Use R itself for updates.

Michelle
  • 1,281
  • 2
  • 16
  • 31
  • Hi Michelle - i opened standalone R and installed lubridate. But when I open RStudio inside DSX Desktop, I don’t see that package. – Carl Mar 13 '18 at 23:42
  • Hi Carl, that is one strange problem. I haven't installed any new packages, only updated the ones I have. Perhaps another RStudio user could share their insights. – Michelle Mar 13 '18 at 23:48
  • The other thought I have had is that RStudio could be pointing to the wrong folder directory for packages. Did you have an earlier version of R installed? – Michelle Mar 14 '18 at 00:00
  • I tried re-pointing the package library per below, but it stays pointed at some erroneous library. `> .libPaths("C:/Program Files/R/R-3.4.4/library") > .libPaths() [1] "/user-home/_global_/R" "/usr/lib64/R/library" [3] "/usr/share/R/library"` – Carl Mar 16 '18 at 21:13
  • I would reinstall RStudio at this point. When it installs, it should point to the most recent version of R, assuming you have more than one R version installed. RStudio will check your registry settings for the R version it should be using. Reinstalling RStudio will not have any impact on your R folders. – Michelle Mar 17 '18 at 21:51
  • The problem seems to be to do with RStudio running inside my installation of DSX Desktop (on my windows machine). Standalone RStudio on my mac has always behaved nicely. I've raised this on [GitHub](https://github.com/IBMDataScience/DSx-Desktop/issues/57). I've tried 3 installations of DSX, and for good measure an `updateR` (from within R because it wouldn't install in RStudio). – Carl Mar 17 '18 at 22:31
0

I was getting this error: Windows 7, update.packages problem: “unable to move temporary installation”? Which I think was due to my antivirus, but not sure. MRAN version was 3.3.1 and this is what I would do to fix this error everytime I opened R-Studio and needed to install:

trace(utils:::unpackPkgZip, edit=TRUE)
# Edit line 142 - change Sys.sleep(2.5)

I was still having versioning issues with tidyverse, so looked around and decided to install the latest MRAN from Microsoft and that fixed all of my R-Studio versioning issues and install inssues. I had other issues where I was doing a work.

Version info:

Microsoft R Open 3.5.1
The enhanced R distribution from Microsoft
Default CRAN mirror snapshot taken on 2018-08-01.

Download Microsoft R Open 3.5.1

Paul Hegel
  • 61
  • 1
  • 6