2

I installed the package lubridate. I got the following:

> install.packages("lubridate")
Installing package into ‘C:/Users/aw/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/lubridate_1.5.0.zip'
Content type 'application/zip' length 650842 bytes (635 KB)
downloaded 635 KB

package ‘lubridate’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\aw\AppData\Local\Temp\RtmpuSQUFy\downloaded_packages

and afterwards:

> library(lubridate)
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  there is no package called ‘stringi’
In addition: Warning message:
package ‘lubridate’ was built under R version 3.2.3 
Error: package or namespace load failed for ‘lubridate’
Avi
  • 2,247
  • 4
  • 30
  • 52
  • 8
    `install.packages("stringi")` - *there is no package called ‘stringi’* is a dead giveaway. – Rich Scriven Jan 19 '16 at 22:08
  • 1
    Relevant good read: [How should I deal with “package 'xxx' is not available (for R version x.y.z)” warning?](http://stackoverflow.com/questions/25721884) – zx8754 Jan 20 '16 at 08:08

2 Answers2

4

While updating R, it updated all my libraries but it seems if failed at updating lubridate. It was complaining that glue, stringi and stringr had exit stats of 1. The cmd install.packages("lubridate") was building the library and its dependencies from source. However, one of the dependencies was failing as resources were not available in x64 arch. The solution was to install from binaries:

install.packages("glue",type="win.binary")
install.packages("stringi",type="win.binary")
install.packages("stringr",type="win.binary")
install.packages("lubridate",type="win.binary")

For mac users, use mac.binary instead.

Then I test my lubridate installation by running the following script:

library(lubridate)
bday <- dmy("14/10/1979")
month(bday)
#> [1] 10
wday(bday, label = TRUE)
#> [1] Sun
#> Levels: Sun < Mon < Tue < Wed < Thu < Fri < Sat

year(bday) <- 2016
wday(bday, label = TRUE)
#> [1] Fri
#> Levels: Sun < Mon < Tue < Wed < Thu < Fri < Sat

Kf

K F
  • 1,368
  • 13
  • 20
3

Thanks to @Richard Scriven. I installed the package stringi:

install.packages("stringi")
Avi
  • 2,247
  • 4
  • 30
  • 52