我正在尝试安装R的包lubridate,但我总是有相同的错误消息。 环顾四周看起来它有一个已经存在的函数date()这一事实 也作为base :: date()。但是在测试包时,它会调用date(),因此会调用错误。
我得到的是:
install.packages("lubridate")
Installing package into ‘/home/user/R/i586-pc-linux-gnu-library/3.3’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/lubridate_1.6.0.tar.gz'
Content type 'unknown' length 317672 bytes (310 KB)
==================================================
downloaded 310 KB
* installing *source* package ‘lubridate’ ...
** package ‘lubridate’ successfully unpacked and MD5 sums checked
** libs
installing to /home/user/R/i586-pc-linux-gnu-library/3.3/lubridate/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error in as.POSIXlt(x, tz = tz(x)) :
argument "x" is missing, with no default
Calls: .Last -> cat -> paste -> date -> date.default -> as.POSIXlt
Execution halted
ERROR: loading failed
* removing ‘/home/user/R/i586-pc-linux-gnu-library/3.3/lubridate’
Warning in install.packages :
installation of package ‘lubridate’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpuzZ3SK/downloaded_packages’
这里是我的sessionInfo():
sessionInfo()
R version 3.3.3 (2017-03-06)
Platform: i586-pc-linux-gnu (32-bit)
Running under: Debian GNU/Linux 8 (jessie)
locale:
[1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_GB.UTF-8 LC_COLLATE=en_GB.UTF-8
[5] LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8
[7] LC_PAPER=en_GB.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] graphics grDevices utils methods base
loaded via a namespace (and not attached):
[1] tools_3.3.3
知道如何避免这个问题吗?
答案 0 :(得分:1)
问题解决了。
这只是因为行
猫(膏(日期(), “\ nAdios \ n” 个))
在文件中:
〜/ .Rprofile
必须在〜/ .Rprofile中删除对date()的调用。
详情请见: https://github.com/business-science/tidyquant/issues/62