Issues with packages after updating to R 3.5.0

Hello,

I updated to the last R version yesterday (3.5.0, "Joy in Playing") and, while I had to reinstall a few packages after an R update in the past (often "Rcpp" or "stringi"), this time I had to reinstall all my packages. I am not sure if this is due to a major change in R (maybe the fact that now all packages are by default byte-compiled on installation???), or something wrong on my end.

So first, I would be curious to hear from those who have updated to the latest R (released yesterday, so maybe not too many people yet).

But then, I am running into an issue when trying to reinstall rlang (which I need to reinstall the tidyverse). Here is the error I am getting:

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  namespace ‘rlang’ 0.2.0 is already loaded, but >= 0.2.0.9001 is required

But 0.2.0 is the last rlang release...

Again, there could be something going on in my system. I tried uninstalling and reinstalling R, but I have the same problem. I would welcome any thought on this.

Thank you!

1 Like

Based on that error message, it sounds like you need the dev. version of rlang for 3.5.0 compatibility, so you'd have to install it using devtools. (Though I'm still kind of puzzled by that since the Travis builds look fine:
https://travis-ci.org/r-lib/rlang/builds/367670613
As do the CRAN Checks for the released version, with the exception of a WARN for Solaris:
https://cran.r-project.org/web/checks/check_results_rlang.html)

For major release versions I've previously had to reinstall all of my packages (before figuring out how to move libraries, etc the last couple of times), so I'm not surprised that a couple of them at least would need reinstalls.

I haven't updated yet, so no first-hand experience on this one, but you could at least give the devtools install for rlang a whirl and see what happens!

3 Likes

Thank you @mara :slight_smile:

I thought of it, but I found it very surprising that tidyverse would need a devel version of rlang to run under the latest R. So I thought that there might be something else going on.

I'll give it a try and update.

(Note that my need to reinstall packages is not because of library location. Apparently, the new R needs packages to be recompiled, again, maybe because they are now all byte-compiled on installation. It is the first time I have to reinstall them all though, so I was a little worried that something could be going on on my end. I am on Arch Linux and things do go wrong sometimes upon update...).

Ya, something fishy is going on. I'd be happy to hear from others who have updated R to figure out if it is my system or not.

I can't install the devel version of rlang with devtools while I have never had any issue with this in the past.

Upon running the usual:

devtools::install_github("r-lib/rlang", build_vignettes = TRUE)

I get:

Error: package ‘devtools’ was installed by an R version with different internals; it needs to be reinstalled for use with this R version
1 Like

Did you try reinstalling devtools?

Note: uninstalling rlang first has no effect.

Ah! I can't read lol. The error message was super clear, but I tend to react way too quickly without reading carefully (did the same mistake a few times while trying to answer people's questions on this forum too...). So I read rlang instead of devtools. Sigh. Thanks again @mara!

1 Like

So I am unstuck with the rlang problem and I will keep on reinstalling packages.

But, unless it is something on my end, it seems that the devel version of rlang is needed after an update of R... So the maintainers might want to have a look at this. I won't post an issue until I know for sure it isn't just me though.

1 Like

So... now I have another problem :confused:

I can't reinstall ddalpha and get this error message:

Error in system2(file.path(R.home("bin"), "R"), c(if (nzchar(arch)) paste0("--arch=",  : 
  cannot popen ' '/usr/lib64/R/bin/R' --no-save --slave 2>&1 < '/tmp/RtmpU4dXOt/file3fb5b89c507'', probable reason 'Cannot allocate memory'

Considering that I have 16Gb of RAM and usually never get even close to using it all, I am a little surprised... This is likely to be an Arch Linux problem and not an R problem though. So I will post on the Arch Linux forum if nobody can help here.

Thanks! Updating R usually goes so smoothly...

use this link to help full to update new version

I don't have issues updating R. I am having issues while reinstalling a few of the many packages I had to reinstall after this upgrade.

1 Like

By this thread I have my fingers crossed for a few weeks until most of the packages are updated in cran. Thanks for opening the thread

how do you install the packages individually

install.packages("<package>")

e.g. install.packages("magrittr")

Big changes behind the scenes in R 3.5.0

A major update to R is now available. The R Core group has announced the release of R 3.5.0, and binary versions for Windows and Linux are now available from the primary CRAN mirror. (The Mac release is forthcoming.)

Probably the biggest change in R 3.5.0 will be invisible to most users — except by the performance improvements it brings. The ALTREP project has now been rolled into R to use more efficient representations of many vectors, resulting in less memory usage and faster computations in many common situations. For example, the sequence vector 1:1000000 is now represented just by its start and end value, instead of allocating a vector of a million elements as earlier versions of R would do. So while R 3.4.3 takes about 1.5 seconds to run x <- 1:1e9 on my laptop, it's instantaneous in R 3.5.0.

There have been improvements in other areas too, thanks to ALTREP. The output of the sort function has a new representation: it includes a flag indicating that the vector is already sorted, so that sorting it again is instantaneous. As a result, running x <- sort(x) is now free the second and subsequent times you run it, unlike earlier versions of R. This may seem like a contrived example, but operations like this happen all the time in the internals of R code. Another good example is converting a numeric to a character vector: as.character(x) is now also instantaneous (the coercion to character is deferred until the character representation is actually needed). This has significant impact in R's statistical modelling functions, which carry around a long character vector that usually contains just numbers — the row names — with the design matrix. As a result, the calculation:

d <- data.frame(y = rnorm(1e7), x = 1:1e7)
lm(y ~ x, data=d)

runs about 4x faster on my system. (It also uses a lot less memory: running the equivalent command with 10x more rows failed for me in R 3.4.3 but succeeded in 3.5.0.)

The ALTREP system is designed to be extensible, but in R 3.5.0 the system is used exclusively for the internal operations of R. Nonetheless, if you'd like to get a sneak peek on how you might be able to use ALTREP yourself in future versions of R, you can take a look at this vignette (with the caveat that the interface may change when it's finally released).

There are many other improvements in R 3.5.0 beyond the ALTREP system, too. You can find the full details in the announcement, but here are a few highlights:

  • All packages are now byte-compiled on installation. R's base and recommended packages, and packages on CRAN, were already byte-compiled, so this will have the effect of improving the performance of packages installed from Github and from private sources.

  • R's performance is better when many packages are loaded, and more packages can be loaded at the same time on Windows (when packages use compiled code).

  • Improved support for long vectors, by functions including object.size, approx and spline.

  • Reading in text data with readLines and scan should be faster, thanks to buffering on text connections.

  • R should handle some international data files better, with several bugs related to character encodings having been resolved.

I downloaded R 3.5 and tried to install data.table and it didn't work so I simply switched back to older version.

if data.table and tidyverse doesn't work than I don't need new version. it would crash all my scripts.

:sunglasses::sunglasses:

3 Likes

They do work. They just need to be re-compiled with the new built (so re-installed. And this can take a bit of effort since you will also have to re-install some of their dependencies).

The new built is a lot faster and has great improvements. And ultimately, you will have to upgrade to keep up with things. So you should give it another try, when you have a bit of time.

1 Like

I reinstalled but it just didn't work. Then I went to their page and saw an issue already open. So I decided to wait for sometime

1 Like

o data.table, deu um trabalho, mas consegui pelo devtools. Não estou conseguindo resolver o XMLSchema.

1 Like

Like the OP I had to re-install all user packages but I didn't need the development version of rlang. I also made the mistake of using the 'installr' package and saying yes to copying packages from the last version which rendered all of the system packages unusable (sigh).

To do the bulk installation I used:

pkgs <- installed.packages()
ii <- is.na(pkgs[, "Priority"])
pkgs <- pkgs[ii, 1]
install.packages(pkgs)
1 Like