[問題類型]:
程式諮詢(我想用R 做某件事情,但是我不知道要怎麼用R 寫出來)
[軟體熟悉度]:
入門(寫過其他程式,只是對語法不熟悉) & linux 新手
[問題敘述]:
想要在 Linux底下用 crontab 排程 執行 R 程式
用 Rstudio 直接執行,就一切正常
但是換到用 crontab 設定排程就會產生錯誤..
主要是說 bitops 與 XML 套件找不到...!
請問是不是要把我所需要的套件設成 R 裡面預設的套件?
除require("套件名稱") 與 library("套件名稱")之外
有其它的做法嗎?
PS. 其實我有寫一個小程式來測試 crontab 來執行 R 程式, 執行結果是正常的...
以下為輸出的錯誤訊息:
Loading required package: bitops
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE,
logical.return = TRUE, : there is no package called ‘bitops’
Loading required package: XML
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return =
TRUE, : there is no package called ‘XML’
Loading required package: RCurl
Warning message:In library(package, lib.loc = lib.loc, character.only
= TRUE, logical.return = TRUE, : there is no package called ‘RCurl’
Loading required package: DBI
Loading required package: methods
Loading required package: RMySQL
Error in library(bitops) : there is no package called ‘bitops’
停止執行
[環境敘述]:
請提供 sessionInfo() 的輸出結果,
R version 3.2.4 Revised (2016-03-16 r70336)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.4 LTS
locale:
[1] LC_CTYPE=zh_TW.UTF-8 LC_NUMERIC=C LC_TIME=zh_TW.UTF-8
[4] LC_COLLATE=zh_TW.UTF-8 LC_MONETARY=zh_TW.UTF-8 LC_MESSAGES=zh_TW.UTF-8
[7] LC_PAPER=zh_TW.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=zh_TW.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RMySQL_0.10.8 DBI_0.3.1 RCurl_1.95-4.8 XML_3.98-1.4 bitops_1.0-6
loaded via a namespace (and not attached):
[1] tools_3.2.4
感謝各位大大
謝謝