[R] R-3.4.0 fails test

Peter Dalgaard pdalgd at gmail.com
Wed May 17 13:21:43 CEST 2017


> On 17 May 2017, at 12:31 , Henric Winell <nilsson.henric at gmail.com> wrote:
> 
> On 2017-05-17 09:42, Patrick Connolly wrote:
> 
>> After installing R-3.4.0 I ran 'make check'  which halted here:
>> $ > tail reg-tests-1d.Rout.fail -n 16
> 
> This problem was brought up on the R-devel list early this morning.  See https://stat.ethz.ch/pipermail/r-devel/2017-May/074275.html

Looks like that one is not the same, occurring a handful of lines further up.

Anyways, you might want to 

a) move the discussion to R-devel
b) include your platform (hardware, OS) and time zone info
c) run the offending code lines "by hand" and show us the values of format(dlt) and format(dct) so we can see what the problem is, something like

dlt <- structure(
    list(sec = 52, min = 59L, hour = 18L, mday = 6L, mon = 11L, year = 116L,
       wday = 2L, yday = 340L, isdst = 0L, zone = "CET", gmtoff = 3600L),
       class = c("POSIXlt", "POSIXt"), tzone = c("", "CET", "CEST"))
dlt$sec <- 10000 + 1:10 
dct <- as.POSIXct(dlt)
cbind(format(dlt), format(dct))


-pd


> Henric Winell
> 
> 
> 
> 
>>> ## format()ing invalid hand-constructed  POSIXlt  objects
>>> d <- as.POSIXlt("2016-12-06"); d$zone <- 1
>>> tools::assertError(format(d))
>>> d$zone <- NULL
>>> stopifnot(identical(format(d),"2016-12-06"))
>>> d$zone <- "CET" # = previous, but 'zone' now is last
>>> tools::assertError(format(d))
>>> dlt <- structure(
>> +     list(sec = 52, min = 59L, hour = 18L, mday = 6L, mon = 11L, year = 116L,
>> +          wday = 2L, yday = 340L, isdst = 0L, zone = "CET", gmtoff = 3600L),
>> +     class = c("POSIXlt", "POSIXt"), tzone = c("", "CET", "CEST"))
>>> dlt$sec <- 10000 + 1:10 # almost three hours & uses re-cycling ..
>>> fd <- format(dlt)
>>> stopifnot(length(fd) == 10, identical(fd, format(dct <- as.POSIXct(dlt))))
>> Error: identical(fd, format(dct <- as.POSIXct(dlt))) is not TRUE
>> Execution halted
>> ... so, of course, the remaining tests aren't done.
>> AFAICT, that test will fail anywhere outside of tzone CET, but I could
>> be missing something.
>> What is the point of this test and is there a better way to move on to
>> the remaining tests besides editing the corresponding .R file?
>> Changing the line
>>> stopifnot(length(fd) == 10, identical(fd, format(dct <- as.POSIXct(dlt))))
>> to
>>> stopifnot(length(fd) == 10, identical(fd, format(dct <- as.POSIXlt(dlt))))
>>                                                                 ^^^^
>> would pass.  But would that be any use?
>> TIA
>> (Linux Mint 17.3)
>> 
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list