install.packages() Rstudio server AWS ubuntu error

限于喜欢 提交于 2020-01-16 04:02:10

问题


I have an AWS instance running ubuntu 12.04 and shiny server as well as Rstudio, however, when I try to add packages, I get an error when trying to load the library()

for the following command: install.packages("jsonlite", dependencies = TRUE, repos="http://cran.cs.wwu.edu") terminal output shows the download happens without any issues with the following as the last line The downloaded source packages are in ‘/tmp/RtmpO02nLU/downloaded_packages’

Clearly library() shows an error eg// Error in library(jsonlite) : there is no package called ‘jsonlite’ Is there something wrong with this process? how can I install packages to work with my Instance/ environment?

EDIT:: I realise there is the option of creating a swap file, wondering with the t1 instance, is there something really inefficient with the set up? rather than doing this or just upgrading the instance with throwing more memory at it..


回答1:


You may want to sudo R to run R. Otherwise it won't allow you to install R package into the R library directory. Once you sudo R, then use install.packages again. Hope it works for you. I had similar problem before.




回答2:


I had the same issue using a Virtual Machine through vagrant.

After updating the R version, I got the useful warning that the installation of the R package shiny failed because of lack of memory. I was using 512 Mb for RAM, this is not enough. After tweaking the Vagrantfile:

config.vm.provider "virtualbox" do |vb|
  # Customize the amount of memory on the VM:
  b.memory = "2048"
end

It worked out. Of note, to install dplyr I had to increase the virtual memory to 2048 Mb.

Hope this helps



来源:https://stackoverflow.com/questions/22601407/install-packages-rstudio-server-aws-ubuntu-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!