简体   繁体   中英

R lubridate package installation - Lazy loading failed

I am trying to install lubridate in R on ubuntu. I am getting below error. Understand from other sources that this is something to do with my system. Can you please help me to overcome this issue:

> 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

I ran into the same error attempting to install lubridate today in R version 2.15.3 on Red Hat. After I saw your question I went to CRAN to check the release date of the latest version (1.3.2) of lubridate. That release date was 11-26-2013 - just a few days ago. From the lubridate archive page , I downloaded the archive for the previous version, lubridate_1.3.1.tar.gz, which was released 10-31-2013.

Using the command -

R CMD INSTALL lubridate_1.3.1.tar.gz

I was able to install lubridate 1.3.1 in my R 2.15.3 installation.

If you read the error and have the same message as me:

"Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : namespace 'Rcpp' 0.12.12 is being loaded, but >= 0.12.13 is required"

You probably need to install first the Rcpp package and then try to install the lubridate package...it worked for me!

For Windows, get the latest version here: https://cran.r-project.org/web/packages/lubridate/index.html

And install with install.packages(path_to_file, repos = NULL, type="source") as described here: https://stackoverflow.com/a/1474125/2745116

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM