4

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
NelsonGon
  • 13,015
  • 7
  • 27
  • 57
Chandra
  • 526
  • 2
  • 9
  • 26

3 Answers3

6

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.

  • 1
    Thank you@Dale Kutyna.. It was very helpful..and I ran into problems with RCurl installation also. This link helped me for RCurl problem.. http://www.omegahat.org/RCurl/FAQ.html – Chandra Dec 04 '13 at 15:47
1

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!

NelsonGon
  • 13,015
  • 7
  • 27
  • 57
Antonio Canepa
  • 299
  • 2
  • 5
0

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

stefanbschneider
  • 5,460
  • 8
  • 50
  • 88