6

I am running a new install of R (3.5.0) and RStudio (1.1.414). [Note I have now updated to 3.5.1 and 1.1.453 and am still experiencing the issues below with the exception of the "built under R version 3.5.1" warning messages]

I have installed the rlang package using install.packages("rlang") without encountering any issues but when I attempt to load the package I get the following error

Error: package or namespace load failed for ‘rlang’: .onLoad failed in loadNamespace() for 'rlang', details: call: dots_list(...) error: object 'rlang_dots_list' not found In addition: Warning message: package ‘rlang’ was built under R version 3.5.1

I've uninstalled and reinstalled rlang (closing restarting RStudio in between each command) and am still encountering this error.

I am also encountering a set of similar (although possible totally unrelated) issue with other packages

  1. RStudio provides the following warning every startup

    [Workspace loaded from ~/.RData] Error in yaml.load(readLines(con), error.label = error.label, ...) : object 'C_unserialize_from_yaml' not found Error in yaml.load(readLines(con), error.label = error.label, ...) : object 'C_unserialize_from_yaml' not found 
  2. library(devtools) gives the following errors

    Error: package or namespace load failed for ‘devtools’ in FUN(X[[i]], ...): no such symbol digest in package //[redacted]/My Documents/R/win-library/3.5/digest/libs/x64/digest.dll In addition: Warning message: package ‘devtools’ was built under R version 3.5.1 

Someone on twitter asked for the results of packageDescription("rlang")

I've copied the output below in case it helps with troubleshooting.

Package: rlang Version: 0.2.1 Title: Functions for Base Types and Core R and 'Tidyverse' Features Description: A toolbox for working with base types, core R features like the condition system, and core 'Tidyverse' features like tidy evaluation. Authors@R: c( person("Lionel", "Henry", ,"[email protected]", c("aut", "cre")), person("Hadley", "Wickham", ,"[email protected]", "aut"), person("RStudio", role = "cph") ) License: GPL-3 LazyData: true ByteCompile: true Depends: R (>= 3.1.0) Suggests: crayon, knitr, methods, pillar, rmarkdown (>= 0.2.65), testthat, covr RoxygenNote: 6.0.1 URL: http://rlang.tidyverse.org, https://github.com/r-lib/rlang BugReports: https://github.com/r-lib/rlang/issues NeedsCompilation: yes Packaged: 2018-05-30 13:14:55 UTC; lionel Author: Lionel Henry [aut, cre], Hadley Wickham [aut], RStudio [cph] Maintainer: Lionel Henry <[email protected]> Repository: CRAN Date/Publication: 2018-05-30 14:23:07 UTC Built: R 3.5.1; x86_64-w64-mingw32; 2018-07-02 15:08:55 UTC; windows -- File: [redacted]/My Documents/R/win-library/3.5/rlang/Meta/package.rds 
15
  • You can try installing packages in R (which comes with R 3.5.1, not RStudio). Use thisinstall.packages(c("rlang", "devtools", "yaml"), repos = "https://cran.rstudio.com", dependencies = TRUE) Commented Jul 5, 2018 at 0:31
  • FYI, R 3.5.1 was released yesterday & RStudio 1.1.453 is the latest so update while you're at it Commented Jul 5, 2018 at 0:32
  • Edit: in the past I used Rterm.exe in C:\Program Files\R\R-3.5.1\bin\x64 Commented Jul 5, 2018 at 0:43
  • @Tung I've updated my R and RStudio versions (unfortunately I had to first convince my workplace to approve them) and installed the packages through R 3.5.1 however, I'm still getting the same rlang error. Commented Jul 5, 2018 at 1:41
  • Try this community.rstudio.com/t/… As far as R and RStudio go, you don't need admin right to install them. Just install to any folder that you have write permission. RStudio also has zip package ready to use iirc Commented Jul 5, 2018 at 2:33

3 Answers 3

5

You have 3 different warnings (digest, yaml, and rlang) that each indicate that a package DLL file is corrupted. You are doing something very wrong when installing your packages.

The most common cause of this problem is trying to update a package while it is loaded in R (possibly in another process!). It could also be caused by a bad antivirus program that locks the dll which prevents it from being updated. Please try the following steps:

  1. Quit all R/Rstudio sessions. Check in taskmgr that no Rterm or Rgui process is running.
  2. Delete the folders yaml, rlang and digest inside Documents\R\win-library\3.5\ and also inside C:\Program Files\R\R-3.5.x\library\ if they exists there as well.
  3. Start R to confirm they are gone. Running library(yaml) or library(rlang) should give an error e.g: there is no package called ‘yaml’. Quit R.
  4. Start a new R and run: install.packages(c("yaml", "rlang", "digest"))
  5. Pay close attention to the output, especially the final lines. If you see a warning like below the installation got corrupted and you should remove the package!

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

As mentioned above, my institutional IT can replicate this on a laptop with a completely fresh R install and no prior package installations (meaning isn't to do with installing with another version of the package already running). No error messages are returned. However, I am increasingly thinking it's something to do with how my IT has set permissions that are causing things to quietly fail.
3

Answering my own question in case anyone else encounters a similar issue in the future...

Working with my work IT department we have now tied this to custom permissions on my workstation that mean that R packages can only be run to pre-specified libraries (in my case "C:\R\R-3.4.3\library").

Installing packages directly into that location fixes the issue but is not desirable for all the reasons that people might want to use custom locations (e.g. running multiple versions of the same package, keeping separate libraries for some projects).

As such there are two solutions that may be more or less attainable given your own IT system.

  1. Convince your IT department to relax the permissions for R packages to allow custom library locations.
  2. Give up and run everything from the "permitted" library location (e.g. C:\R\R-3.4.3\library)
  3. Raise a support ticket every time you need to install a package into a custom location and hope that IT eventually gives in.

Comments

0

This sort of problems almost always comes from a bug in R on Windows: If you reinstall a package that includes compiled code, and if that package is already loaded in R, the DLL will not get updated.

Please try reinstalling rlang on a fresh session. Sometimes packages get loaded automatically at startup from .RProfile and you can check this by calling sessionInfo() after starting up.

3 Comments

We've tried this - and can replicate this issue on a completely new install with no existing package installs.
Sorry about that :( Does .libPaths() return suspicious library paths?
No, I've got this installing to .../My Documents/R/win-library/3.5/ which is showing as expected and there is nothing there that I would not expect. At this stage I feel like it must be something specific with the permissions on my work computer, IT has just done a massive update to lock things down. We did some testing and the problem appears to disappear when I run as Admin (which is not something IT will generally let me do). Not really sure where to go from here since it seems like it might be an issue specific to my work setup.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.