在測試《機器學習 實用案例解析》一書的郵件分類代碼時,windows系統下rstudio中沒法讀取特殊字符,在ubuntu下能夠。在ubuntu虛擬機下安裝tm包(install.packages("tm"))時,提示R版本太低(須要3.1,可是隻有3.0,最新版本是3.2),百度了下,網上的資料說,須要配置下/etc/apt/sources.list文件,即下載列表,包括R官方網站給出的方法也是如此。這些資料和R官網的說明地址以下:html
http://blog.fens.me/r-install-ubuntu/linux
http://my.oschina.net/explore/blog/102481ubuntu
https://cran.r-project.org/windows
可是按照上面的說明嘗試,卻遇到錯誤:機器學習
The following packages have unmet dependencies: r-base : Depends: r-base-core (>= 3.2.2-1quantal0) but it is not going to be installed Depends: r-recommended (= 3.2.2-1quantal0) but it is not going to be installed Recommends: r-base-html but it is not going to be installed E: Unable to correct problems, you have held broken packages.學習
以「ubuntu 升級r版本」爲關鍵字百度,始終沒有找到解決辦法。測試
以「ubuntu 更新r版本 the following packages have unmet dependencies r-base-core」爲關鍵字搜索,找到stackoverflow上面的一個帖子(http://stackoverflow.com/questions/15260250/re-installing-r-linux-ubuntu-unmet-dependencies-r),其中提到的解決方法是:網站
Try thisthis
If you have added a line from new ubuntu repository to /etc/apt/sources.list, erase the line. Then, run the commandsspa
sudo add-apt-repository ppa:marutter/rrutter
sudo apt-get update
sudo apt-get upgrade
It worked for me, the answer comes from here http://r.789695.n4.nabble.com/Upgrading-on-Ubuntu-from-2-11-1-to-2-15-1-td4636965.html
問題解決,R版本升級到3.2.2,安裝tm,ggplot2包成功。