I keep getting a similar error when trying to install xml2
and readr
packages on Rstudio server runnning on an EC2 instance as this posted thread question:
Unable to install XML package in R on CentOS
I was successful with installing the xml2
package from the terminal with the following command:
sudo yum install libxml2-devel
and then installing & loading the package on the Rstudio server.
However the readr
package I have had no luck. It keeps saying that it was downloaded in a termporary file. Also the following command did not work in the terminal
sudo yum install libreadr-devel
How do I install the readr
package? It seems like somepackages can be installed straight from the Rstudio server and other from the terminal.
This is the error I get when trying to install the `readr package.
install.packages("readr")
Installing package into ‘/home/jessica/R/x86_64-redhat-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/readr_1.3.1.tar.gz'
Content type 'application/x-gzip' length 268853 bytes (262 KB)
==================================================
downloaded 262 KB
* installing *source* package ‘readr’ ...
** package ‘readr’ successfully unpacked and MD5 sums checked
** libs
g++ -m64 -I/usr/include/R -DNDEBUG -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/BH/include" -I/usr/local/include -I. -Ircon -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c Collector.cpp -o Collector.o
virtual memory exhausted: Cannot allocate memory
make: *** [Collector.o] Error 1
ERROR: compilation failed for package ‘readr’
* removing ‘/home/jessica/R/x86_64-redhat-linux-gnu-library/3.4/readr’
Warning in install.packages :
installation of package ‘readr’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmphwt8ya/downloaded_packages’