4

我正在尝试lubridate 在 ubuntu 上安装 R。我得到以下错误。从其他来源了解这与我的系统有关。你能帮我解决这个问题吗:

> install.packages('lubridate')
Installing package(s) into ‘/home/leader/R/i686-pc-linux-gnu-library/2.15’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/lubridate_1.3.2.tar.gz'
Content type 'application/x-gzip' length 284897 bytes (278 Kb)
opened URL
==================================================
downloaded 278 Kb

* installing *source* package ‘lubridate’ ...
** package ‘lubridate’ successfully unpacked and MD5 sums checked
** R
** data
**  moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in setClass("Period", contains = c("Timespan", "numeric"), slots = c(year =    "numeric",  : 
 unused argument(s) (slots = c(year = "numeric", month = "numeric", day = "numeric", hour = "numeric", minute = "numeric"))
Error : unable to load R code in package ‘lubridate’
ERROR: lazy loading failed for package ‘lubridate’
* removing ‘/home/leader/R/i686-pc-linux-gnu-library/2.15/lubridate’
Warning message:
 In install.packages("lubridate") :
  installation of package ‘lubridate’ had non-zero exit status
4

3 回答 3

6

我今天在 Red Hat 上的 R 版本 2.15.3 中尝试安装 lubridate 时遇到了同样的错误。看到你的问题后,我去 CRAN 检查了最新版本(1.3.2)的 lubridate 的发布日期。发布日期是 2013 年 11 月 26 日——就在几天前。从lubridate 存档页面,我下载了之前版本的存档 lubridate_1.3.1.tar.gz,它于 2013 年 10 月 31 日发布。

使用命令 -

R CMD 安装 lubridate_1.3.1.tar.gz

我能够在我的 R 2.15.3 安装中安装 lubridate 1.3.1。

于 2013-12-03T20:14:59.573 回答
1

如果您阅读了错误并收到与我相同的消息:

“loadNamespace 中的错误(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :正在加载命名空间 'Rcpp' 0.12.12,但是 > = 0.12.13 是必需的"

您可能需要先安装Rcpp软件包,然后尝试安装lubridate软件包……它对我有用!

于 2018-06-07T10:17:31.740 回答
0

对于 Windows,请在此处获取最新版本:https ://cran.r-project.org/web/packages/lubridate/index.html

install.packages(path_to_file, repos = NULL, type="source")按照此处所述安装:https ://stackoverflow.com/a/1474125/2745116

于 2018-03-07T14:46:54.280 回答