r - Rscript "there is no package" -
i have script loads data, processes it, , saves processed data out. run manually without problem, not work rscript. uses data.table package, , rscript cannot find it. have tried the solution here following error message:
error in eval(expr, envir, enclos) : not find function ".getnamespace" in addition: warning message: package ‘data.table’ built under r version 3.1.1 error : unable load r code in package ‘chron’ error: package/namespace load failed ‘data.table’ execution halted
the script looks like:
#!/usr/local/bin/rscript args = commandargs(trailingonly = true) # take arguments command line library.path <- '/home/zack/r/x86_64-redhat-linux-gnu-library/3.1' library('data.table', lib.loc = library.path)
that code after failing library(data.table). can load data.table fine, , rest of script works, if manually. command submit bash is:
nohup /usr/local/bin/rscript --vanilla <path script> <args> &
session info:
> sessioninfo() r version 3.1.1 (2014-07-10) platform: x86_64-redhat-linux-gnu (64-bit) locale: [1] lc_ctype=en_us.utf-8 lc_numeric=c [3] lc_time=en_us.utf-8 lc_collate=en_us.utf-8 [5] lc_monetary=en_us.utf-8 lc_messages=en_us.utf-8 [7] lc_paper=en_us.utf-8 lc_name=c [9] lc_address=c lc_telephone=c [11] lc_measurement=en_us.utf-8 lc_identification=c attached base packages: [1] stats graphics grdevices utils datasets methods base
which rscript:
/usr/local/bin/rscript
/usr/local/bin/r loads data.table fine when called in interactive session.
Comments
Post a Comment