您尚未登录。

#1 2017-05-19 13:43:32

ll1735
会员
注册时间: 2014-10-18
帖子: 27

R语言 个人library使用问题

按照wiki配置的R语言环境

# ~/.Renviron 

R_HOME_USER = ${HOME}/workspace/R
R_PROFILE_USER = ${HOME}/.Rprofile
R_LIBS_USER = ${HOME}/bin/R/packages
R_HISTFILE = ${HOME}/.Rhistory
#R_DEFAULT_PACKAGES = 'stats'

当前在bash用个人账户执行
Rscript --vanilla "ElementaryFactor.R"

会出现

Loading required package: RJDBC
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘RJDBC’
Loading required package: RSQLite
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘RSQLite’
Error in JDBC("com.microsoft.sqlserver.jdbc.SQLServerDriver", "/home/liuli/bin/jdbcDriver/sqljdbc4.jar") : 
  could not find function "JDBC"
Execution halted

${HOME}/bin/R/packages 下面是有RJDBC的,然后在root下安装RJDBC后就会解决这个问题。
说明执行个人账户 Rscript --vanilla "ElementaryFactor.R"  不会调用个人library下面的包,但进入R的命令行加载这个包或者在Rstadio里面不会出现这个状况。

离线

页脚