ubuntu下安裝R語言與Rstutio
sudo gedit /etc/apt/sources.list
儲存(trusty為Ubuntu的版本號)ubuntu14
deb http://cran.stat.ucla.edu/bin/linux/ubuntu/ trusty/
2.2在命令列執行:
sudo apt-get update (更新源)
sudo apt-get install r-base r-recommended(安裝)
or
sudo apt-get upgrade(更新)
or
sudo apt-get install r-base
sudo apt-get install r-base-dev 從原始碼安裝 R
可能會遇到的問題:
Thefollowing signatures couldn't be verified because the public key isnot available: NO_PUBKEY 51716619E084DAB9
解決方法如下:
獲取key
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
更新apt-key
gpg -a --export E084DAB9 | sudo apt-key add -
安裝Rstudio
去下載對應自己系統的安裝檔案: http://www.rstudio.com/products/rstudio/download/
sudo apt-get install gdebi-core
sudo apt-get install libapparmor1 # Required only for Ubuntu, not Debian
sudo gdebi rstudio-0.99.903-i386.deb # 下載的Rstudio的deb安裝包
終端輸入rstudio
測試
在Rstudio裡安裝ggplot2
install.packages('plyr')
install.packages('digest')
install.packages('gtable')
install.packages('reshape2')
install.packages('scales')
install.packages('proto')
install.packages('ggplot2')