1

I followed the instructions to run R on AWS to solve local memory issues in computing. I would like to run caret but I am running into this error when I try to load the package using library(caret).

Error: package or namespace load failed for ‘caret’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): namespace ‘rlang’ 0.4.7 is already loaded, but >= 1.0.3 is required

I've restarted my Rstudio session and have uninstalled/re-install rlang but the issue persists. I am suspecting the issue is an outdated version of R because > sessionInfo() provides:

  • R version 4.0.2 (2020-06-22)
  • Platform: x86_64-pc-linux-gnu (64-bit)
  • Running under: Ubuntu 18.04.5 LTS

Does anyone have any ideas on how to fix the issue?

A similar problem was raised here, but the solution provided did not help.

thou
  • 35
  • 4
  • What does `.libPaths()` show? Is this a corporate machine? Sometimes corporate setups have internal repositories, which may need updating. Can you paste the printout when you do install.packages("Rlang")? – Isaiah Jan 02 '23 at 03:08
  • Say no to "Do you want to install from sources the package which needs compilation? (Yes/no/cancel)". – Isaiah Jan 02 '23 at 03:17
  • 1
    Not exactly sure what you mean by "corporate machine", but I'm using my own personal computer if that's what you're asking. Readouts here: https://docs.google.com/document/d/1m5Dv4MLou5gWVqRt1IXyCnPToyrjK9EiK78CaWljwgo/edit?usp=sharing – thou Jan 03 '23 at 06:32
  • R 4. should be enough, but it's common to update R and RStudio when you hit install problems, and it may work via a side effect. After that, `remove.packages("rlang")` then `install.packages("rlang")`. There have been times that I've had to manually remove packages. I'm curious as to what `find.package('caret')` returns. `pack <- available.packages() pack["caret","Depends"]` returns ggplot2 and lattice. A common trouble shooting package install tactic is to install dependencies first. – Isaiah Jan 04 '23 at 03:12
  • By corporate machine, I was checking if you had a managed repository like jfrog. – Isaiah Jan 04 '23 at 03:16
  • 1
    I don't think I have a managed repository, at least, I didn't knowingly create one when I created the server. I've updated the google doc w/ the requested readouts. Kinda weird, but after leaving it for a couple of days and coming back appears to have solved my issue. Thanks for your help! – thou Jan 09 '23 at 04:37

0 Answers0