Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datetime issue on one CRAN machine #2825

Closed
mattdowle opened this issue May 3, 2018 · 3 comments
Closed

Datetime issue on one CRAN machine #2825

mattdowle opened this issue May 3, 2018 · 3 comments
Milestone

Comments

@mattdowle
Copy link
Member

@mattdowle mattdowle commented May 3, 2018

Fail on one CRAN machine: r-release-linux-x86_64.
Tweet also here : https://twitter.com/MattDowle/status/991767160530731009

CRAN Log
using R version 3.5.0 (2018-04-23)
using platform: x86_64-pc-linux-gnu (64-bit)
using session charset: UTF-8
checking for file ‘data.table/DESCRIPTION’ ... OK
this is package ‘data.table’ version ‘1.11.0’
checking package namespace information ... OK
checking package dependencies ... OK
checking if this is a source package ... OK
checking if there is a namespace ... OK
checking for executable files ... OK
checking for hidden files and directories ... OK
checking for portable file names ... OK
checking for sufficient/correct file permissions ... OK
checking serialization versions ... OK
checking whether package ‘data.table’ can be installed ... OK
checking package directory ... OK
checking ‘build’ directory ... OK
checking DESCRIPTION meta-information ... OK
checking top-level files ... OK
checking for left-over files ... OK
checking index information ... OK
checking package subdirectories ... OK
checking R files for non-ASCII characters ... OK
checking R files for syntax errors ... OK
checking whether the package can be loaded ... OK
checking whether the package can be loaded with stated dependencies ... OK
checking whether the package can be unloaded cleanly ... OK
checking whether the namespace can be loaded with stated dependencies ... OK
checking whether the namespace can be unloaded cleanly ... OK
checking loading without being on the library search path ... OK
checking use of S3 registration ... OK
checking dependencies in R code ... OK
checking S3 generic/method consistency ... OK
checking replacement functions ... OK
checking foreign function calls ... OK
checking R code for possible problems ... [24s/31s] OK
checking Rd files ... OK
checking Rd metadata ... OK
checking Rd line widths ... OK
checking Rd cross-references ... OK
checking for missing documentation entries ... OK
checking for code/documentation mismatches ... OK
checking Rd \usage sections ... OK
checking Rd contents ... OK
checking for unstated dependencies in examples ... OK
checking line endings in C/C++/Fortran sources/headers ... OK
checking line endings in Makefiles ... OK
checking compilation flags in Makevars ... OK
checking for GNU extensions in Makefiles ... OK
checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
checking include directives in Makefiles ... OK
checking pragmas in C/C++ headers and code ... OK
checking compilation flags used ... OK
checking compiled code ... OK
checking installed files from ‘inst/doc’ ... OK
checking files in ‘vignettes’ ... OK
checking examples ... ERROR
Running examples in ‘data.table-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: IDateTime
> ### Title: Integer based date class
> ### Aliases: IDate as.IDate ITime as.ITime IDateTime as.character.ITime
> ### as.chron.IDate as.chron.ITime as.Date.IDate as.IDate.Date
> ### as.IDate.default as.ITime.character as.ITime.default as.ITime.POSIXlt
> ### as.ITime.times as.list.IDate as.POSIXct.IDate as.POSIXct.ITime
> ### as.POSIXlt.ITime c.IDate cut.IDate format.ITime IDateTime.default
> ### mean.IDate print.ITime rep.IDate rep.ITime round.IDate seq.IDate
> ### split.IDate second minute hour yday wday mday week isoweek month
> ### quarter year IDate-class ITime-class
> ### Keywords: utilities chron
> 
> ### ** Examples
> 
> 
> # create IDate:
> (d <- as.IDate("2001-01-01"))
[1] "2001-01-01"
> 
> # S4 coercion also works
> identical(as.IDate("2001-01-01"), as("2001-01-01", "IDate"))
[1] TRUE
> 
> # create ITime:
> (t <- as.ITime("10:45"))
[1] "10:45:00"
> 
> # S4 coercion also works
> identical(as.ITime("10:45"), as("10:45", "ITime"))
[1] TRUE
> 
> (t <- as.ITime("10:45:04"))
[1] "10:45:04"
> 
> (t <- as.ITime("10:45:04", format = "%H:%M:%S"))
[1] "10:45:04"
> 
> as.POSIXct("2001-01-01") + as.ITime("10:45")
[1] "2001-01-01 10:45:00 CET"
> 
> datetime <- seq(as.POSIXct("2001-01-01"), as.POSIXct("2001-01-03"), by = "5 hour")
> (af <- data.table(IDateTime(datetime), a = rep(1:2, 5), key = "a,idate,itime"))
         idate itime a
 1: 2001-01-01 00:00:00 1
 2: 2001-01-01 10:00:00 1
 3: 2001-01-01 20:00:00 1
 4: 2001-01-02 06:00:00 1
 5: 2001-01-02 16:00:00 1
 6: 2001-01-01 05:00:00 2
 7: 2001-01-01 15:00:00 2
 8: 2001-01-02 01:00:00 2
 9: 2001-01-02 11:00:00 2
10: 2001-01-02 21:00:00 2
> 
> af[, mean(a), by = "itime"]
       itime V1
 1: 00:00:00 1
 2: 10:00:00 1
 3: 20:00:00 1
 4: 06:00:00 1
 5: 16:00:00 1
 6: 05:00:00 2
 7: 15:00:00 2
 8: 01:00:00 2
 9: 11:00:00 2
10: 21:00:00 2
> af[, mean(a), by = list(hour = hour(itime))]
    hour V1
 1: 0 1
 2: 10 1
 3: 20 1
 4: 6 1
 5: 16 1
 6: 5 2
 7: 15 2
 8: 1 2
 9: 11 2
10: 21 2
> af[, mean(a), by = list(wday = factor(weekdays(idate)))]
      wday V1
1: Monday 1.4
2: Tuesday 1.6
> af[, mean(a), by = list(wday = wday(idate))]
   wday V1
1: 2 1.4
2: 3 1.6
> 
> as.POSIXct(af$idate)
 [1] "2001-01-01 UTC" "2001-01-01 UTC" "2001-01-01 UTC" "2001-01-02 UTC"
 [5] "2001-01-02 UTC" "2001-01-01 UTC" "2001-01-01 UTC" "2001-01-02 UTC"
 [9] "2001-01-02 UTC" "2001-01-02 UTC"
> as.POSIXct(af$idate, time = af$itime)
 [1] "2001-01-01 00:00:00 UTC" "2001-01-01 10:00:00 UTC"
 [3] "2001-01-01 20:00:00 UTC" "2001-01-02 06:00:00 UTC"
 [5] "2001-01-02 16:00:00 UTC" "2001-01-01 05:00:00 UTC"
 [7] "2001-01-01 15:00:00 UTC" "2001-01-02 01:00:00 UTC"
 [9] "2001-01-02 11:00:00 UTC" "2001-01-02 21:00:00 UTC"
> as.POSIXct(af$idate, af$itime)
 [1] "2001-01-01 00:00:00 UTC" "2001-01-01 10:00:00 UTC"
 [3] "2001-01-01 20:00:00 UTC" "2001-01-02 06:00:00 UTC"
 [5] "2001-01-02 16:00:00 UTC" "2001-01-01 05:00:00 UTC"
 [7] "2001-01-01 15:00:00 UTC" "2001-01-02 01:00:00 UTC"
 [9] "2001-01-02 11:00:00 UTC" "2001-01-02 21:00:00 UTC"
> as.POSIXct(af$idate, time = af$itime, tz = "GMT")
 [1] "2001-01-01 00:00:00 GMT" "2001-01-01 10:00:00 GMT"
 [3] "2001-01-01 20:00:00 GMT" "2001-01-02 06:00:00 GMT"
 [5] "2001-01-02 16:00:00 GMT" "2001-01-01 05:00:00 GMT"
 [7] "2001-01-01 15:00:00 GMT" "2001-01-02 01:00:00 GMT"
 [9] "2001-01-02 11:00:00 GMT" "2001-01-02 21:00:00 GMT"
> 
> as.POSIXct(af$itime, af$idate)
 [1] "2001-01-01 00:00:00 UTC" "2001-01-01 10:00:00 UTC"
 [3] "2001-01-01 20:00:00 UTC" "2001-01-02 06:00:00 UTC"
 [5] "2001-01-02 16:00:00 UTC" "2001-01-01 05:00:00 UTC"
 [7] "2001-01-01 15:00:00 UTC" "2001-01-02 01:00:00 UTC"
 [9] "2001-01-02 11:00:00 UTC" "2001-01-02 21:00:00 UTC"
> as.POSIXct(af$itime) # uses today's date
 [1] "2018-05-02 00:00:00 UTC" "2018-05-02 10:00:00 UTC"
 [3] "2018-05-02 20:00:00 UTC" "2018-05-02 06:00:00 UTC"
 [5] "2018-05-02 16:00:00 UTC" "2018-05-02 05:00:00 UTC"
 [7] "2018-05-02 15:00:00 UTC" "2018-05-02 01:00:00 UTC"
 [9] "2018-05-02 11:00:00 UTC" "2018-05-02 21:00:00 UTC"
> 
> (seqdates <- seq(as.IDate("2001-01-01"), as.IDate("2001-08-03"), by = "3 weeks"))
 [1] "2001-01-01" "2001-01-22" "2001-02-12" "2001-03-05" "2001-03-26"
 [6] "2001-04-16" "2001-05-07" "2001-05-28" "2001-06-18" "2001-07-09"
[11] "2001-07-30"
> round(seqdates, "months")
 [1] "2001-01-01" "2001-01-01" "2001-02-01" "2001-03-01" "2001-03-01"
 [6] "2001-04-01" "2001-05-01" "2001-05-01" "2001-06-01" "2001-07-01"
[11] "2001-07-01"
> 
> if (require(chron)) {
+ as.chron(as.IDate("2000-01-01"))
+ as.chron(as.ITime("10:45"))
+ as.chron(as.IDate("2000-01-01"), as.ITime("10:45"))
+ as.chron(as.ITime("10:45"), as.IDate("2000-01-01"))
+ as.ITime(chron(times = "11:01:01"))
+ IDateTime(chron("12/31/98","10:45:00"))
+ }
Loading required package: chron
Error in strptime(x, format, tz = tz) : invalid 'x' argument
Calls: as.chron ... as.POSIXct -> as.POSIXlt -> as.POSIXlt.character -> strptime
Execution halted
checking for unstated dependencies in ‘tests’ ... OK
checking tests ... [90s/111s] OK
  Running ‘autoprint.R’ [0s/1s]
  Comparing ‘autoprint.Rout’ to ‘autoprint.Rout.save’ ... OK
  Running ‘knitr.R’ [1s/1s]
  Comparing ‘knitr.Rout’ to ‘knitr.Rout.save’ ... OK
  Running ‘main.R’ [88s/108s]
  Running ‘testthat.R’ [1s/2s]
checking for unstated dependencies in vignettes ... OK
checking package vignettes in ‘inst/doc’ ... OK
checking re-building of vignette outputs ... [17s/20s] OK
checking PDF version of manual ... OK
DONE
Status: 1 ERROR
@mattdowle mattdowle added this to the 1.11.2 milestone May 3, 2018
@MichaelChirico
Copy link
Member

@MichaelChirico MichaelChirico commented May 3, 2018

@jangorecki
Copy link
Member

@jangorecki jangorecki commented May 3, 2018

Part of the log referred to an old error, see line in out

this is package ‘data.table’ version ‘1.10.4-3’

@jangorecki jangorecki closed this May 3, 2018
@jangorecki
Copy link
Member

@jangorecki jangorecki commented May 3, 2018

CRAN log has updated now with 1.11.0 results. 1 error remains so reopening.
https://www.r-project.org/nosvn/R.check/r-release-linux-x86_64/data.table-00check.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants