Re: [Rd] [R] R-3.4.0 fails test

2017-05-19 Thread Martyn Plummer
I have fixed this in R-devel and will port it over to the R release branch in 
due course.

The underlying issue is that the conversion from POSIXlt to POSIXct uses the 
local time zone and not the CET time zone. I believe this is a bug, but I will 
take up that discussion elsewhere.

Martyn

From: Patrick Connolly <p_conno...@slingshot.co.nz>
Sent: 19 May 2017 06:13
To: Martin Maechler
Cc: peter dalgaard; Martyn Plummer; Joris Meys; R-devel
Subject: Re: [Rd] [R] R-3.4.0 fails test

On Thu, 18-May-2017 at 05:46PM +0200, Martin Maechler wrote:

|>
.

|>
|> Being pretty "stretched" time wise currently, I'm happy for
|> timezone-portable propositions to change the test.

Meantime, anyone who lives where DST happpens in December who wants to
get through the remaining tests can avoid this one by 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

(which effectively isn't testing anything much)

A less lazy way would be to comment out the relevant lines.


|>
|> Martin

--
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
   ___Patrick Connolly
 {~._.~}   Great minds discuss ideas
 _( Y )_ Average minds discuss events
(:_~*~_:)  Small minds discuss people
 (_)-(_)  . Eleanor Roosevelt

~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
---
This message and its attachments are strictly confidenti...{{dropped:8}}

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] [R] R-3.4.0 fails test

2017-05-18 Thread Patrick Connolly
On Thu, 18-May-2017 at 05:46PM +0200, Martin Maechler wrote:

|> 
.

|> 
|> Being pretty "stretched" time wise currently, I'm happy for
|> timezone-portable propositions to change the test.

Meantime, anyone who lives where DST happpens in December who wants to
get through the remaining tests can avoid this one by 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

(which effectively isn't testing anything much)

A less lazy way would be to comment out the relevant lines.


|> 
|> Martin

-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___Patrick Connolly   
 {~._.~}   Great minds discuss ideas
 _( Y )_ Average minds discuss events 
(:_~*~_:)  Small minds discuss people  
 (_)-(_)  . Eleanor Roosevelt
  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] [R] R-3.4.0 fails test

2017-05-18 Thread Martin Maechler

> > On 18 May 2017, at 14:58 , Martyn Plummer  wrote:
> > 
> >> On 18 May 2017, at 14:51, peter dalgaard  wrote:

> >>> On 18 May 2017, at 13:47 , Joris Meys  wrote:
> >>> 
> >>> Correction: Also dlt uses the default timezone, but POSIXlt is not 
> >>> recalculated whereas POSIXct is. Reason for that is the different way 
> >>> values are stored (hours, minutes, seconds as opposed to minutes from 
> >>> origin, as explained in my previous mail)
> >>> 
> >> 
> >> I would suspect that there is something more subtle going on, New Zealand 
> >> time is 10, 11, or 12 hours from Central European, depending on time of 
> >> year (10 in our Summer, 12 in theirs and 11 during the overlap at both 
> >> ends, if you must know), and we are talking a 1 hour difference.  
> >> 
> >> However DST transitions were both in March/April, so that's not it. Maybe 
> >> a POSIX[lc]t expert can comment?
> > 
> > If I change the month from December to June then I see the same phenomenon 
> > in my Europe/Paris time zone. The issue seems to be that, for the date 
> > chosen for the test, Summer/daylight savings time is in force in NZ and 
> > some other parts of the southern hemisphere , but not in the northern 
> > hemisphere.
> > 

> Of course! I overlooked that the date in the test is the issue, not the 
> current date. (Let's blame that on the fact that Summer seems to have finally 
> arrived in Copenhagen...)

> "svn praise" claims this test is due to Martin Maechler in r71742, so maybe 
> he knows how to fix it. (I wonder if he just used the current date at the 
> time, or actually thought that there would be no DST issues in December ;-) )

> -pd

I think the former.  This was about fixing a segmentation fault problem
 (thread from Dec 6, 2016, on the R-devel mailing list, starting
  here: https://stat.ethz.ch/pipermail/r-devel/2016-December/073448.html )
mostly,  but the 2nd part of the regression test evidently needs
more thought than I had put there.

Being pretty "stretched" time wise currently, I'm happy for
timezone-portable propositions to change the test.

Martin

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] [R] R-3.4.0 fails test

2017-05-18 Thread peter dalgaard

> On 18 May 2017, at 14:58 , Martyn Plummer  wrote:
> 
> 
> 
>> On 18 May 2017, at 14:51, peter dalgaard  wrote:
>> 
>> 
>>> On 18 May 2017, at 13:47 , Joris Meys  wrote:
>>> 
>>> Correction: Also dlt uses the default timezone, but POSIXlt is not 
>>> recalculated whereas POSIXct is. Reason for that is the different way 
>>> values are stored (hours, minutes, seconds as opposed to minutes from 
>>> origin, as explained in my previous mail)
>>> 
>> 
>> I would suspect that there is something more subtle going on, New Zealand 
>> time is 10, 11, or 12 hours from Central European, depending on time of year 
>> (10 in our Summer, 12 in theirs and 11 during the overlap at both ends, if 
>> you must know), and we are talking a 1 hour difference.  
>> 
>> However DST transitions were both in March/April, so that's not it. Maybe a 
>> POSIX[lc]t expert can comment?
> 
> If I change the month from December to June then I see the same phenomenon in 
> my Europe/Paris time zone. The issue seems to be that, for the date chosen 
> for the test, Summer/daylight savings time is in force in NZ and some other 
> parts of the southern hemisphere , but not in the northern hemisphere.
> 

Of course! I overlooked that the date in the test is the issue, not the current 
date. (Let's blame that on the fact that Summer seems to have finally arrived 
in Copenhagen...)

"svn praise" claims this test is due to Martin Maechler in r71742, so maybe he 
knows how to fix it. (I wonder if he just used the current date at the time, or 
actually thought that there would be no DST issues in December ;-) )

-pd


> Martyn
> 
>> -pd
>> 
>>> CHeers
>>> Joris
>>> 
>>> On Thu, May 18, 2017 at 1:45 PM, Joris Meys  wrote:
>>> This has to do with your own timezone. If I run that code on my computer, 
>>> both formats are correct. If I do this after 
>>> 
>>> Sys.setenv(TZ = "UTC")
>>> 
>>> Then:
>>> 
 cbind(format(dlt), format(dct))
>>> [,1]  [,2] 
>>> [1,] "2016-12-06 21:45:41" "2016-12-06 20:45:41"
>>> [2,] "2016-12-06 21:45:42" "2016-12-06 20:45:42"
>>> 
>>> The reason for that, is that dlt has a timezone set, but dct doesn't. To be 
>>> correct, it only takes the first value "", which indicates "Use the default 
>>> timezone of the locale".
>>> 
 attr(dlt, "tzone")
>>> [1] "" "CET"  "CEST"
 attr(dct, "tzone")
>>> [1] ""
>>> 
>>> The thing is, in POSIXlt the timezone attribute is stored together with the 
>>> actual values for hour, minute etc. in list format. Changing the timezone 
>>> doesn't change those values, but it will change the time itself:
>>> 
 Sys.unsetenv("TZ")
 dlt2 <- dlt
 attr(dlt2,"tzone") <- "UTC"
 dlt2
>>> [1] "2016-12-06 21:45:41 UTC" "2016-12-06 21:45:42 UTC"
>>> [3] "2016-12-06 21:45:43 UTC" "2016-12-06 21:45:44 UTC"
>>> 
>>> in POSIXct the value doesn't change either, just the attribute. But this 
>>> value is the number of seconds since the origin. So the time itself doesn't 
>>> change, but you'll see a different hour.
>>> 
 dct
>>> [1] "2016-12-06 21:45:41 CET" "2016-12-06 21:45:42 CET"
>>> ...
 attr(dct,"tzone") <- "UTC"
 dct
>>> [1] "2016-12-06 20:45:41 UTC" "2016-12-06 20:45:42 UTC"
>>> [3] "2016-12-06 20:45:43 UTC" "2016-12-06 20:45:44 UTC"
>>> 
>>> So what you see, is simply the result of your timezone settings on your 
>>> computer.
>>> 
>>> Cheers
>>> Joris
>>> 
 On Thu, May 18, 2017 at 1:19 PM, peter dalgaard  wrote:
 
 On 18 May 2017, at 11:00 , Patrick Connolly  
 wrote:
 
 On Wed, 17-May-2017 at 01:21PM +0200, Peter Dalgaard wrote:
 
 |>
 |> Anyways, you might want to
 |>
 |> a) move the discussion to R-devel
 |> b) include your platform (hardware, OS) and time zone info
 
 System:Host: MTA-V1-427894 Kernel: 3.19.0-32-generic x86_64 (64 bit 
 gcc: 4.8.2)
 Desktop: KDE Plasma 4.14.2 (Qt 4.8.6) Distro: Linux Mint 17.3 Rosa
>>> 
>>> I suppose that'll do...
>>> 
>>> 
 Time zone: NZST
>>> 
>>> 
>>> 
 
 |> 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 <- 1 + 1:10
 |> dct <- as.POSIXct(dlt)
 |> cbind(format(dlt), format(dct))
 
> cbind(format(dlt), format(dct))
[,1]  [,2]
 [1,] "2016-12-06 21:45:41" "2016-12-06 22:45:41"
 [2,] "2016-12-06 21:45:42" "2016-12-06 22:45:42"
 [3,] "2016-12-06 21:45:43" "2016-12-06 22:45:43"
 [4,] "2016-12-06 21:45:44" "2016-12-06 

Re: [Rd] [R] R-3.4.0 fails test

2017-05-18 Thread Martyn Plummer


> On 18 May 2017, at 14:51, peter dalgaard  wrote:
> 
> 
>> On 18 May 2017, at 13:47 , Joris Meys  wrote:
>> 
>> Correction: Also dlt uses the default timezone, but POSIXlt is not 
>> recalculated whereas POSIXct is. Reason for that is the different way values 
>> are stored (hours, minutes, seconds as opposed to minutes from origin, as 
>> explained in my previous mail)
>> 
> 
> I would suspect that there is something more subtle going on, New Zealand 
> time is 10, 11, or 12 hours from Central European, depending on time of year 
> (10 in our Summer, 12 in theirs and 11 during the overlap at both ends, if 
> you must know), and we are talking a 1 hour difference.  
> 
> However DST transitions were both in March/April, so that's not it. Maybe a 
> POSIX[lc]t expert can comment?

If I change the month from December to June then I see the same phenomenon in 
my Europe/Paris time zone. The issue seems to be that, for the date chosen for 
the test, Summer/daylight savings time is in force in NZ and some other parts 
of the southern hemisphere , but not in the northern hemisphere.

Martyn

> -pd
> 
>> CHeers
>> Joris
>> 
>> On Thu, May 18, 2017 at 1:45 PM, Joris Meys  wrote:
>> This has to do with your own timezone. If I run that code on my computer, 
>> both formats are correct. If I do this after 
>> 
>> Sys.setenv(TZ = "UTC")
>> 
>> Then:
>> 
>>> cbind(format(dlt), format(dct))
>>  [,1]  [,2] 
>> [1,] "2016-12-06 21:45:41" "2016-12-06 20:45:41"
>> [2,] "2016-12-06 21:45:42" "2016-12-06 20:45:42"
>> 
>> The reason for that, is that dlt has a timezone set, but dct doesn't. To be 
>> correct, it only takes the first value "", which indicates "Use the default 
>> timezone of the locale".
>> 
>>> attr(dlt, "tzone")
>> [1] "" "CET"  "CEST"
>>> attr(dct, "tzone")
>> [1] ""
>> 
>> The thing is, in POSIXlt the timezone attribute is stored together with the 
>> actual values for hour, minute etc. in list format. Changing the timezone 
>> doesn't change those values, but it will change the time itself:
>> 
>>> Sys.unsetenv("TZ")
>>> dlt2 <- dlt
>>> attr(dlt2,"tzone") <- "UTC"
>>> dlt2
>> [1] "2016-12-06 21:45:41 UTC" "2016-12-06 21:45:42 UTC"
>> [3] "2016-12-06 21:45:43 UTC" "2016-12-06 21:45:44 UTC"
>> 
>> in POSIXct the value doesn't change either, just the attribute. But this 
>> value is the number of seconds since the origin. So the time itself doesn't 
>> change, but you'll see a different hour.
>> 
>>> dct
>> [1] "2016-12-06 21:45:41 CET" "2016-12-06 21:45:42 CET"
>> ...
>>> attr(dct,"tzone") <- "UTC"
>>> dct
>> [1] "2016-12-06 20:45:41 UTC" "2016-12-06 20:45:42 UTC"
>> [3] "2016-12-06 20:45:43 UTC" "2016-12-06 20:45:44 UTC"
>> 
>> So what you see, is simply the result of your timezone settings on your 
>> computer.
>> 
>> Cheers
>> Joris
>> 
>>> On Thu, May 18, 2017 at 1:19 PM, peter dalgaard  wrote:
>>> 
>>> On 18 May 2017, at 11:00 , Patrick Connolly  
>>> wrote:
>>> 
>>> On Wed, 17-May-2017 at 01:21PM +0200, Peter Dalgaard wrote:
>>> 
>>> |>
>>> |> Anyways, you might want to
>>> |>
>>> |> a) move the discussion to R-devel
>>> |> b) include your platform (hardware, OS) and time zone info
>>> 
>>> System:Host: MTA-V1-427894 Kernel: 3.19.0-32-generic x86_64 (64 bit 
>>> gcc: 4.8.2)
>>>  Desktop: KDE Plasma 4.14.2 (Qt 4.8.6) Distro: Linux Mint 17.3 Rosa
>> 
>> I suppose that'll do...
>> 
>> 
>>> Time zone: NZST
>> 
>> 
>> 
>>> 
>>> |> 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 <- 1 + 1:10
>>> |> dct <- as.POSIXct(dlt)
>>> |> cbind(format(dlt), format(dct))
>>> 
 cbind(format(dlt), format(dct))
>>> [,1]  [,2]
>>> [1,] "2016-12-06 21:45:41" "2016-12-06 22:45:41"
>>> [2,] "2016-12-06 21:45:42" "2016-12-06 22:45:42"
>>> [3,] "2016-12-06 21:45:43" "2016-12-06 22:45:43"
>>> [4,] "2016-12-06 21:45:44" "2016-12-06 22:45:44"
>>> [5,] "2016-12-06 21:45:45" "2016-12-06 22:45:45"
>>> [6,] "2016-12-06 21:45:46" "2016-12-06 22:45:46"
>>> [7,] "2016-12-06 21:45:47" "2016-12-06 22:45:47"
>>> [8,] "2016-12-06 21:45:48" "2016-12-06 22:45:48"
>>> [9,] "2016-12-06 21:45:49" "2016-12-06 22:45:49"
>>> [10,] "2016-12-06 21:45:50" "2016-12-06 22:45:50"
 
>>> 
>> 
>> 
>> So exactly 1 hour out of whack. Is there a Daylight Saving Times issue, 
>> perchance?
>> 
>> -pd
>> 
>> 
>>> 
>>> --
>>> ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
>>>  ___Patrick Connolly
>>> {~._.~}   Great minds discuss ideas

Re: [Rd] [R] R-3.4.0 fails test

2017-05-18 Thread peter dalgaard

> On 18 May 2017, at 13:47 , Joris Meys  wrote:
> 
> Correction: Also dlt uses the default timezone, but POSIXlt is not 
> recalculated whereas POSIXct is. Reason for that is the different way values 
> are stored (hours, minutes, seconds as opposed to minutes from origin, as 
> explained in my previous mail)
> 

I would suspect that there is something more subtle going on, New Zealand time 
is 10, 11, or 12 hours from Central European, depending on time of year (10 in 
our Summer, 12 in theirs and 11 during the overlap at both ends, if you must 
know), and we are talking a 1 hour difference.  

However DST transitions were both in March/April, so that's not it. Maybe a 
POSIX[lc]t expert can comment?

-pd

> CHeers
> Joris
> 
> On Thu, May 18, 2017 at 1:45 PM, Joris Meys  wrote:
> This has to do with your own timezone. If I run that code on my computer, 
> both formats are correct. If I do this after 
> 
> Sys.setenv(TZ = "UTC")
> 
> Then:
> 
> > cbind(format(dlt), format(dct))
>   [,1]  [,2] 
>  [1,] "2016-12-06 21:45:41" "2016-12-06 20:45:41"
>  [2,] "2016-12-06 21:45:42" "2016-12-06 20:45:42"
> 
> The reason for that, is that dlt has a timezone set, but dct doesn't. To be 
> correct, it only takes the first value "", which indicates "Use the default 
> timezone of the locale".
> 
> > attr(dlt, "tzone")
> [1] "" "CET"  "CEST"
> > attr(dct, "tzone")
> [1] ""
> 
> The thing is, in POSIXlt the timezone attribute is stored together with the 
> actual values for hour, minute etc. in list format. Changing the timezone 
> doesn't change those values, but it will change the time itself:
> 
> > Sys.unsetenv("TZ")
> > dlt2 <- dlt
> > attr(dlt2,"tzone") <- "UTC"
> > dlt2
>  [1] "2016-12-06 21:45:41 UTC" "2016-12-06 21:45:42 UTC"
>  [3] "2016-12-06 21:45:43 UTC" "2016-12-06 21:45:44 UTC"
> 
> in POSIXct the value doesn't change either, just the attribute. But this 
> value is the number of seconds since the origin. So the time itself doesn't 
> change, but you'll see a different hour.
> 
> > dct
>  [1] "2016-12-06 21:45:41 CET" "2016-12-06 21:45:42 CET"
> ...
> > attr(dct,"tzone") <- "UTC"
> > dct
>  [1] "2016-12-06 20:45:41 UTC" "2016-12-06 20:45:42 UTC"
>  [3] "2016-12-06 20:45:43 UTC" "2016-12-06 20:45:44 UTC"
> 
> So what you see, is simply the result of your timezone settings on your 
> computer.
> 
> Cheers
> Joris
> 
> On Thu, May 18, 2017 at 1:19 PM, peter dalgaard  wrote:
> 
> > On 18 May 2017, at 11:00 , Patrick Connolly  
> > wrote:
> >
> > On Wed, 17-May-2017 at 01:21PM +0200, Peter Dalgaard wrote:
> >
> > |>
> > |> Anyways, you might want to
> > |>
> > |> a) move the discussion to R-devel
> > |> b) include your platform (hardware, OS) and time zone info
> >
> > System:Host: MTA-V1-427894 Kernel: 3.19.0-32-generic x86_64 (64 bit 
> > gcc: 4.8.2)
> >   Desktop: KDE Plasma 4.14.2 (Qt 4.8.6) Distro: Linux Mint 17.3 Rosa
> 
> I suppose that'll do...
> 
> 
> > Time zone: NZST
> 
> 
> 
> >
> > |> 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 <- 1 + 1:10
> > |> dct <- as.POSIXct(dlt)
> > |> cbind(format(dlt), format(dct))
> >
> >> cbind(format(dlt), format(dct))
> >  [,1]  [,2]
> > [1,] "2016-12-06 21:45:41" "2016-12-06 22:45:41"
> > [2,] "2016-12-06 21:45:42" "2016-12-06 22:45:42"
> > [3,] "2016-12-06 21:45:43" "2016-12-06 22:45:43"
> > [4,] "2016-12-06 21:45:44" "2016-12-06 22:45:44"
> > [5,] "2016-12-06 21:45:45" "2016-12-06 22:45:45"
> > [6,] "2016-12-06 21:45:46" "2016-12-06 22:45:46"
> > [7,] "2016-12-06 21:45:47" "2016-12-06 22:45:47"
> > [8,] "2016-12-06 21:45:48" "2016-12-06 22:45:48"
> > [9,] "2016-12-06 21:45:49" "2016-12-06 22:45:49"
> > [10,] "2016-12-06 21:45:50" "2016-12-06 22:45:50"
> >>
> >
> 
> 
> So exactly 1 hour out of whack. Is there a Daylight Saving Times issue, 
> perchance?
> 
> -pd
> 
> 
> >
> > --
> > ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
> >   ___Patrick Connolly
> > {~._.~}   Great minds discuss ideas
> > _( Y )_Average minds discuss events
> > (:_~*~_:)  Small minds discuss people
> > (_)-(_) . Eleanor Roosevelt
> >
> > ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
> 
> --
> Peter Dalgaard, Professor,
> Center for Statistics, Copenhagen Business School
> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> Phone: (+45)38153501
> Office: A 4.23
> Email: pd@cbs.dk  Priv: 

Re: [Rd] [R] R-3.4.0 fails test

2017-05-18 Thread Joris Meys
Correction: Also dlt uses the default timezone, but POSIXlt is not
recalculated whereas POSIXct is. Reason for that is the different way
values are stored (hours, minutes, seconds as opposed to minutes from
origin, as explained in my previous mail)

CHeers
Joris

On Thu, May 18, 2017 at 1:45 PM, Joris Meys  wrote:

> This has to do with your own timezone. If I run that code on my computer,
> both formats are correct. If I do this after
>
> Sys.setenv(TZ = "UTC")
>
> Then:
>
> > cbind(format(dlt), format(dct))
>   [,1]  [,2]
>  [1,] "2016-12-06 21:45:41" "2016-12-06 20:45:41"
>  [2,] "2016-12-06 21:45:42" "2016-12-06 20:45:42"
>
> The reason for that, is that dlt has a timezone set, but dct doesn't. To
> be correct, it only takes the first value "", which indicates "Use the
> default timezone of the locale".
>
> > attr(dlt, "tzone")
> [1] "" "CET"  "CEST"
> > attr(dct, "tzone")
> [1] ""
>
> The thing is, in POSIXlt the timezone attribute is stored together with
> the actual values for hour, minute etc. in list format. Changing the
> timezone doesn't change those values, but it will change the time itself:
>
> > Sys.unsetenv("TZ")
> > dlt2 <- dlt
> > attr(dlt2,"tzone") <- "UTC"
> > dlt2
>  [1] "2016-12-06 21:45:41 UTC" "2016-12-06 21:45:42 UTC"
>  [3] "2016-12-06 21:45:43 UTC" "2016-12-06 21:45:44 UTC"
>
> in POSIXct the value doesn't change either, just the attribute. But this
> value is the number of seconds since the origin. So the time itself doesn't
> change, but you'll see a different hour.
>
> > dct
>  [1] "2016-12-06 21:45:41 CET" "2016-12-06 21:45:42 CET"
> ...
> > attr(dct,"tzone") <- "UTC"
> > dct
>  [1] "2016-12-06 20:45:41 UTC" "2016-12-06 20:45:42 UTC"
>  [3] "2016-12-06 20:45:43 UTC" "2016-12-06 20:45:44 UTC"
>
> So what you see, is simply the result of your timezone settings on your
> computer.
>
> Cheers
> Joris
>
> On Thu, May 18, 2017 at 1:19 PM, peter dalgaard  wrote:
>
>>
>> > On 18 May 2017, at 11:00 , Patrick Connolly 
>> wrote:
>> >
>> > On Wed, 17-May-2017 at 01:21PM +0200, Peter Dalgaard wrote:
>> >
>> > |>
>> > |> Anyways, you might want to
>> > |>
>> > |> a) move the discussion to R-devel
>> > |> b) include your platform (hardware, OS) and time zone info
>> >
>> > System:Host: MTA-V1-427894 Kernel: 3.19.0-32-generic x86_64 (64 bit
>> gcc: 4.8.2)
>> >   Desktop: KDE Plasma 4.14.2 (Qt 4.8.6) Distro: Linux Mint 17.3
>> Rosa
>>
>> I suppose that'll do...
>>
>>
>> > Time zone: NZST
>>
>>
>>
>> >
>> > |> 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 <- 1 + 1:10
>> > |> dct <- as.POSIXct(dlt)
>> > |> cbind(format(dlt), format(dct))
>> >
>> >> cbind(format(dlt), format(dct))
>> >  [,1]  [,2]
>> > [1,] "2016-12-06 21:45:41" "2016-12-06 22:45:41"
>> > [2,] "2016-12-06 21:45:42" "2016-12-06 22:45:42"
>> > [3,] "2016-12-06 21:45:43" "2016-12-06 22:45:43"
>> > [4,] "2016-12-06 21:45:44" "2016-12-06 22:45:44"
>> > [5,] "2016-12-06 21:45:45" "2016-12-06 22:45:45"
>> > [6,] "2016-12-06 21:45:46" "2016-12-06 22:45:46"
>> > [7,] "2016-12-06 21:45:47" "2016-12-06 22:45:47"
>> > [8,] "2016-12-06 21:45:48" "2016-12-06 22:45:48"
>> > [9,] "2016-12-06 21:45:49" "2016-12-06 22:45:49"
>> > [10,] "2016-12-06 21:45:50" "2016-12-06 22:45:50"
>> >>
>> >
>>
>>
>> So exactly 1 hour out of whack. Is there a Daylight Saving Times issue,
>> perchance?
>>
>> -pd
>>
>>
>> >
>> > --
>> > ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
>> ~.~.~.~.~.~.
>> >   ___Patrick Connolly
>> > {~._.~}   Great minds discuss ideas
>> > _( Y )_Average minds discuss events
>> > (:_~*~_:)  Small minds discuss people
>> > (_)-(_) . Eleanor Roosevelt
>> >
>> > ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
>> ~.~.~.~.~.~.
>>
>> --
>> Peter Dalgaard, Professor,
>> Center for Statistics, Copenhagen Business School
>> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
>> Phone: (+45)38153501
>> Office: A 4.23
>> Email: pd@cbs.dk  Priv: pda...@gmail.com
>>
>> __
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>
>
>
> --
> Joris Meys
> Statistical consultant
>
> Ghent University
> Faculty of Bioscience Engineering
> Department of Mathematical Modelling, Statistics and Bio-Informatics
>
> tel :  +32 (0)9 264 61 79 <+32%209%20264%2061%2079>
> joris.m...@ugent.be
> ---
> Disclaimer : 

Re: [Rd] [R] R-3.4.0 fails test

2017-05-18 Thread Joris Meys
This has to do with your own timezone. If I run that code on my computer,
both formats are correct. If I do this after

Sys.setenv(TZ = "UTC")

Then:

> cbind(format(dlt), format(dct))
  [,1]  [,2]
 [1,] "2016-12-06 21:45:41" "2016-12-06 20:45:41"
 [2,] "2016-12-06 21:45:42" "2016-12-06 20:45:42"

The reason for that, is that dlt has a timezone set, but dct doesn't. To be
correct, it only takes the first value "", which indicates "Use the default
timezone of the locale".

> attr(dlt, "tzone")
[1] "" "CET"  "CEST"
> attr(dct, "tzone")
[1] ""

The thing is, in POSIXlt the timezone attribute is stored together with the
actual values for hour, minute etc. in list format. Changing the timezone
doesn't change those values, but it will change the time itself:

> Sys.unsetenv("TZ")
> dlt2 <- dlt
> attr(dlt2,"tzone") <- "UTC"
> dlt2
 [1] "2016-12-06 21:45:41 UTC" "2016-12-06 21:45:42 UTC"
 [3] "2016-12-06 21:45:43 UTC" "2016-12-06 21:45:44 UTC"

in POSIXct the value doesn't change either, just the attribute. But this
value is the number of seconds since the origin. So the time itself doesn't
change, but you'll see a different hour.

> dct
 [1] "2016-12-06 21:45:41 CET" "2016-12-06 21:45:42 CET"
...
> attr(dct,"tzone") <- "UTC"
> dct
 [1] "2016-12-06 20:45:41 UTC" "2016-12-06 20:45:42 UTC"
 [3] "2016-12-06 20:45:43 UTC" "2016-12-06 20:45:44 UTC"

So what you see, is simply the result of your timezone settings on your
computer.

Cheers
Joris

On Thu, May 18, 2017 at 1:19 PM, peter dalgaard  wrote:

>
> > On 18 May 2017, at 11:00 , Patrick Connolly 
> wrote:
> >
> > On Wed, 17-May-2017 at 01:21PM +0200, Peter Dalgaard wrote:
> >
> > |>
> > |> Anyways, you might want to
> > |>
> > |> a) move the discussion to R-devel
> > |> b) include your platform (hardware, OS) and time zone info
> >
> > System:Host: MTA-V1-427894 Kernel: 3.19.0-32-generic x86_64 (64 bit
> gcc: 4.8.2)
> >   Desktop: KDE Plasma 4.14.2 (Qt 4.8.6) Distro: Linux Mint 17.3
> Rosa
>
> I suppose that'll do...
>
>
> > Time zone: NZST
>
>
>
> >
> > |> 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 <- 1 + 1:10
> > |> dct <- as.POSIXct(dlt)
> > |> cbind(format(dlt), format(dct))
> >
> >> cbind(format(dlt), format(dct))
> >  [,1]  [,2]
> > [1,] "2016-12-06 21:45:41" "2016-12-06 22:45:41"
> > [2,] "2016-12-06 21:45:42" "2016-12-06 22:45:42"
> > [3,] "2016-12-06 21:45:43" "2016-12-06 22:45:43"
> > [4,] "2016-12-06 21:45:44" "2016-12-06 22:45:44"
> > [5,] "2016-12-06 21:45:45" "2016-12-06 22:45:45"
> > [6,] "2016-12-06 21:45:46" "2016-12-06 22:45:46"
> > [7,] "2016-12-06 21:45:47" "2016-12-06 22:45:47"
> > [8,] "2016-12-06 21:45:48" "2016-12-06 22:45:48"
> > [9,] "2016-12-06 21:45:49" "2016-12-06 22:45:49"
> > [10,] "2016-12-06 21:45:50" "2016-12-06 22:45:50"
> >>
> >
>
>
> So exactly 1 hour out of whack. Is there a Daylight Saving Times issue,
> perchance?
>
> -pd
>
>
> >
> > --
> > ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
> >   ___Patrick Connolly
> > {~._.~}   Great minds discuss ideas
> > _( Y )_Average minds discuss events
> > (:_~*~_:)  Small minds discuss people
> > (_)-(_) . Eleanor Roosevelt
> >
> > ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
>
> --
> Peter Dalgaard, Professor,
> Center for Statistics, Copenhagen Business School
> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> Phone: (+45)38153501
> Office: A 4.23
> Email: pd@cbs.dk  Priv: pda...@gmail.com
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



-- 
Joris Meys
Statistical consultant

Ghent University
Faculty of Bioscience Engineering
Department of Mathematical Modelling, Statistics and Bio-Informatics

tel :  +32 (0)9 264 61 79
joris.m...@ugent.be
---
Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] [R] R-3.4.0 fails test

2017-05-18 Thread peter dalgaard

> On 18 May 2017, at 11:00 , Patrick Connolly  
> wrote:
> 
> On Wed, 17-May-2017 at 01:21PM +0200, Peter Dalgaard wrote:
> 
> |> 
> |> Anyways, you might want to 
> |> 
> |> a) move the discussion to R-devel
> |> b) include your platform (hardware, OS) and time zone info
> 
> System:Host: MTA-V1-427894 Kernel: 3.19.0-32-generic x86_64 (64 bit gcc: 
> 4.8.2)
>   Desktop: KDE Plasma 4.14.2 (Qt 4.8.6) Distro: Linux Mint 17.3 Rosa

I suppose that'll do...


> Time zone: NZST



> 
> |> 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 <- 1 + 1:10 
> |> dct <- as.POSIXct(dlt)
> |> cbind(format(dlt), format(dct))
> 
>> cbind(format(dlt), format(dct))
>  [,1]  [,2] 
> [1,] "2016-12-06 21:45:41" "2016-12-06 22:45:41"
> [2,] "2016-12-06 21:45:42" "2016-12-06 22:45:42"
> [3,] "2016-12-06 21:45:43" "2016-12-06 22:45:43"
> [4,] "2016-12-06 21:45:44" "2016-12-06 22:45:44"
> [5,] "2016-12-06 21:45:45" "2016-12-06 22:45:45"
> [6,] "2016-12-06 21:45:46" "2016-12-06 22:45:46"
> [7,] "2016-12-06 21:45:47" "2016-12-06 22:45:47"
> [8,] "2016-12-06 21:45:48" "2016-12-06 22:45:48"
> [9,] "2016-12-06 21:45:49" "2016-12-06 22:45:49"
> [10,] "2016-12-06 21:45:50" "2016-12-06 22:45:50"
>> 
> 


So exactly 1 hour out of whack. Is there a Daylight Saving Times issue, 
perchance?

-pd


> 
> -- 
> ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
>   ___Patrick Connolly   
> {~._.~}   Great minds discuss ideas
> _( Y )_Average minds discuss events 
> (:_~*~_:)  Small minds discuss people  
> (_)-(_) . Eleanor Roosevelt
> 
> ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

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

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] [R] R-3.4.0 fails test

2017-05-18 Thread Patrick Connolly
On Wed, 17-May-2017 at 01:21PM +0200, Peter Dalgaard wrote:

|> 
|> Anyways, you might want to 
|> 
|> a) move the discussion to R-devel
|> b) include your platform (hardware, OS) and time zone info

System:Host: MTA-V1-427894 Kernel: 3.19.0-32-generic x86_64 (64 bit gcc: 
4.8.2)
   Desktop: KDE Plasma 4.14.2 (Qt 4.8.6) Distro: Linux Mint 17.3 Rosa
Machine:   System: innotek product: VirtualBox v: 1.2
   Mobo: Oracle model: VirtualBox v: 1.2 Bios: innotek v: VirtualBox 
date: 12/01/2006
CPU:   Quad core Intel Core i7-4790 (-MCP-) cache: 8192 KB
   flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3) bmips: 28734
   clock speeds: max: 3591 MHz 1: 3591 MHz 2: 3591 MHz 3: 3591 MHz 4: 
3591 MHz
Graphics:  Card: InnoTek Systemberatung VirtualBox Graphics Adapter bus-ID: 
00:02.0
   Display Server: X.Org 1.17.1 drivers: vboxvideo (unloaded: 
fbdev,vesa) Resolution: 1920x1080@60.0hz
   GLX Renderer: Chromium GLX Version: 2.1 Chromium 1.9 Direct 
Rendering: Yes
Audio: Card Intel 82801AA AC'97 Audio Controller driver: snd_intel8x0 
ports: d100 d200 bus-ID: 00:05.0
   Sound: Advanced Linux Sound Architecture v: k3.19.0-32-generic
Network:   Card: Intel 82540EM Gigabit Ethernet Controller
   driver: e1000 v: 7.3.21-k8-NAPI port: d240 bus-ID: 00:08.0
   IF: eth0 state: up speed: 1000 Mbps duplex: full mac: 
Drives:HDD Total Size: 131.7GB (56.5% used) ID-1: /dev/sda model: 
VBOX_HARDDISK size: 131.7GB
Partition: ID-1: / size: 117G used: 66G (60%) fs: ext4 dev: /dev/sda1
   ID-2: swap-1 size: 4.16GB used: 0.00GB (0%) fs: swap dev: /dev/sda5
RAID:  No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   None detected - is lm-sensors installed and configured?
Info:  Processes: 256 Uptime: 17:01 Memory: 3533.8/14955.3MB Init: Upstart 
runlevel: 2 Gcc sys: 4.8.4
   Client: Shell (bash 4.3.111) inxi: 2.2.28 


Time zone: NZST

|> 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 <- 1 + 1:10 
|> dct <- as.POSIXct(dlt)
|> cbind(format(dlt), format(dct))

> cbind(format(dlt), format(dct))
  [,1]  [,2] 
 [1,] "2016-12-06 21:45:41" "2016-12-06 22:45:41"
 [2,] "2016-12-06 21:45:42" "2016-12-06 22:45:42"
 [3,] "2016-12-06 21:45:43" "2016-12-06 22:45:43"
 [4,] "2016-12-06 21:45:44" "2016-12-06 22:45:44"
 [5,] "2016-12-06 21:45:45" "2016-12-06 22:45:45"
 [6,] "2016-12-06 21:45:46" "2016-12-06 22:45:46"
 [7,] "2016-12-06 21:45:47" "2016-12-06 22:45:47"
 [8,] "2016-12-06 21:45:48" "2016-12-06 22:45:48"
 [9,] "2016-12-06 21:45:49" "2016-12-06 22:45:49"
[10,] "2016-12-06 21:45:50" "2016-12-06 22:45:50"
> 


-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___Patrick Connolly   
 {~._.~}   Great minds discuss ideas
 _( Y )_ Average minds discuss events 
(:_~*~_:)  Small minds discuss people  
 (_)-(_)  . Eleanor Roosevelt
  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel