problems installing tidyverse package in R.Studio.cloud

Hi, I am having problems in installing tidyverse package in R.Studio.cloud, indeed when I try to open it
library(tidyverse)
I receive the following error message:
Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘readr’

I tried to install readr package and it failed with the following message:

install.packages("readr")
Installing package into ‘/home/rstudio-user/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.org/src/contrib/readr_1.4.0.tar.gz'
Content type 'application/x-gzip' length 488946 bytes (477 KB)
==================================================
downloaded 477 KB

  • installing source package ‘readr’ ...
    ** package ‘readr’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    g++ -std=gnu++11 -I"/opt/R/4.0.2/lib/R/include" -DNDEBUG -I'/home/rstudio-user/R/x86_64-pc-linux-gnu-library/4.0/BH/include' -I'/home/rstudio-user/R/x86_64-pc-linux-gnu-library/4.0/cpp11/include' -I/usr/local/include -fpic -g -O2 -c Collector.cpp -o Collector.o
    g++: internal compiler error: Killed (program cc1plus)
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
    make: *** [Collector.o] Error 4
    /opt/R/4.0.2/lib/R/etc/Makeconf:176: recipe for target 'Collector.o' failed
    ERROR: compilation failed for package ‘readr’
  • removing ‘/home/rstudio-user/R/x86_64-pc-linux-gnu-library/4.0/readr’
    Warning in install.packages :
    installation of package ‘readr’ had non-zero exit status

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

How can I fix this issue (I'm not a techy...) ?
Thank you in advance for your help!

This happens from time to time when a new package version is out, the reason is that the package requires more than 1GB of memory to compile and that is the default RStudio Cloud memory limit (you can increase it if you have a paid account), the way RStudio Cloud addresses this issue is by caching precompiled binaries of the packages but it could take some time for the cache to update to the current package version.

Alternatively, you could try installing a previous version with this command:

remotes::install_version("readr", version = "1.3.1", repos = 'https://packagemanager.rstudio.com/cran/__linux__/xenial/latest')
1 Like

Thank you so much Andres! your alternative proposal solved the problem

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.