[問題] centos 更新r的問題

看板R_Language作者 ( )時間5年前 (2019/03/12 16:36), 編輯推噓1(1014)
留言15則, 4人參與, 5年前最新討論串1/1
我想要更新server的R 不管是用 sudo yum install R 或是 yum update R 都顯示 Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: free.nchc.org.tw * epel: mirror01.idc.hinet.net * extras: free.nchc.org.tw * ius: mirrors.tuna.tsinghua.edu.cn * updates: free.nchc.org.tw Package R-3.5.2-2.el7.x86_64 already installed and latest version Nothing to do 表示R已是最新版本? 但是當我執行R時 R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-unknown-linux-gnu (64-bit) 卻還是2.15.2的舊版本 不知道為何會這樣 有人可以幫忙解疑惑嗎? 感謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.109.32.9 ※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1552379799.A.162.html

03/12 17:01, 5年前 , 1F
很基本的linux概念,檢查路徑 $PATH
03/12 17:01, 1F

03/12 17:02, 5年前 , 2F
意思是,你的系統可能有很多套R,但path優先用了舊的。
03/12 17:02, 2F

03/12 17:04, 5年前 , 3F
而你也可以指定路徑而指定要運作的某一套
03/12 17:04, 3F

03/12 17:05, 5年前 , 4F
例如輸入 /some/where/bin/R
03/12 17:05, 4F

03/12 20:39, 5年前 , 5F
Rscript -e "R.home()"
03/12 20:39, 5F

03/12 20:39, 5年前 , 6F
看看現在的R指向哪裏...
03/12 20:39, 6F

03/12 20:40, 5年前 , 7F
新裝的R多數情況下 在/usr/lib64/R裡面
03/12 20:40, 7F

03/12 20:40, 5年前 , 8F
M$ Open R會在/opt/microsoft裡面
03/12 20:40, 8F

03/12 20:41, 5年前 , 9F
找到新R 就去把vim /usr/bin/R改成你要指向的R
03/12 20:41, 9F

03/12 20:41, 5年前 , 10F
注意的是 系統是不是有其他人會用到系統預設的R...
03/12 20:41, 10F

03/12 22:14, 5年前 , 11F
/usr/local/bin/R
03/12 22:14, 11F

03/13 01:16, 5年前 , 12F
先在shell下指令'which R'找出你現在使用R的路徑位置
03/13 01:16, 12F

03/13 01:17, 5年前 , 13F
然後cd到根目錄 'cd /'
03/13 01:17, 13F

03/13 01:17, 5年前 , 14F
然後'find ./ -name 'R' -print | grep bin/R' 找出
03/13 01:17, 14F

03/13 01:18, 5年前 , 15F
其他版本R的路徑。
03/13 01:18, 15F
文章代碼(AID): #1SXs-N5Y (R_Language)