[Rd] [<-.POSIXlt changes order of attributes (PR#9197)

From: <gregor.gorjanc_at_bfro.uni-lj.si>
Date: Fri 01 Sep 2006 - 11:58:39 GMT


This is a multi-part message in MIME format.

--------------090203020600020104020707
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Hello!

I was doing some tests with identical() and found out that [<-.POSIXlt method changes order of attributes. This example shows that:

x <- strptime("1900-1-1", format="%Y-%m-%d")
x <- c(x)
y <- c(x, x+1)

x1 <- x
y1 <- y

attributes(x)
$names

[1] "sec" "min" "hour" "mday" "mon" "year" "wday" "yday" "isdst"

$class

[1] "POSIXt" "POSIXlt"

$tzone

[1] "" "CET" "CEST" identical(attributes(x), attributes(y))
TRUE x[1] <- NA
attributes(x)
$names

[1] "sec" "min" "hour" "mday" "mon" "year" "wday" "yday" "isdst"

$tzone

[1] "" "CET" "CEST"
$class

[1] "POSIXt" "POSIXlt"

y[1] <- NA
attributes(y)
$names

[1] "sec" "min" "hour" "mday" "mon" "year" "wday" "yday" "isdst"

$tzone

[1] "" "CET" "CEST"
$class

[1] "POSIXt" "POSIXlt"

identical(attributes(x), attributes(x1)) FALSE identical(attributes(y), attributes(y1)) FALSE This can be solved with either:

Index: R/src/library/base/R/datetime.R


or in the same way as it is done in [.<-POSIXct method

Index: R/src/library/base/R/datetime.R


I have checked both versions in r-devel with make check-all and all went fine.

Regards, Gregor

-- 
Lep pozdrav / With regards,
    Gregor Gorjanc

----------------------------------------------------------------------
University of Ljubljana     PhD student
Biotechnical Faculty
Zootechnical Department     URI: http://www.bfro.uni-lj.si/MR/ggorjan
Groblje 3                   mail: gregor.gorjanc <at> bfro.uni-lj.si

SI-1230 Domzale             tel: +386 (0)1 72 17 861
Slovenia, Europe            fax: +386 (0)1 72 17 888

----------------------------------------------------------------------
"One must learn by doing the thing; for though you think you know it,
 you have no certainty until you try." Sophocles ~ 450 B.C.
----------------------------------------------------------------------

--------------090203020600020104020707
Content-Type: application/x-gzip;
 name="datetime.R.patchVer1.gz"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="datetime.R.patchVer1.gz"

H4sICH7v90QCA2RhdGV0aW1lLlIucGF0Y2hWZXIxAKVOz0vDMBQ+m7/ieUvosmxMGYpCwdNg
qFSEQekhTbMazBJJ0tkh/u+atE5vO/guyft+vW9lGtlfQ8G8E0yr2nF3YDX3khWs4UEGtZPT
At3+fxCl9NSdM+zkXnllDSyuZheXBGVZdtr0bt2rMi0I+3YgKM+BLueLyXwG2fjmOYIPBHHU
Fp9zP9W2VYJrrKVpwwvec91JQgg4GTpncE8GdcLhhsK35fHhabXRYdQiGnmhI2l1c6e599GW
RZiHkEwhOFV3QfpjoBh1kR7+Q1zc75/X60G1tQ4bUAYM3yUzgb4sTVWVqorK5EnAT42/qccO
v8fHNkN6j+ATAfoCTtG/r/sBAAA=
--------------090203020600020104020707
Content-Type: application/x-gzip;
 name="datetime.R.patchVer2.gz"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="datetime.R.patchVer2.gz"

H4sICCXw90QCA2RhdGV0aW1lLlIucGF0Y2hWZXIyAKWOwUoDMRCGz+Ypxp4S0jQuVqSisOCp
UFRWBGHZQ7qbrsE0kSSt6YLvrtmIBxF6cC5J/vm+mSxNJ+MVVNy7lmu1dsId+Fp4ySveiSCD
2spZhW7+X4gxdmzPCXZyr7yyBs4XZ/MLgiilx6V3616V6aG1bweCyhLYZTGfLoCmoyigLBGk
Uht8KvxM2161QmMtTR9e8F7onSSEgJNh5wyOJNNjDtcMvpSH+8flsw7fbO63OjWt7m618D5p
NMVhGJ0QHI5TmITBGjn5UTKZiHzPA9P77mm1ytTGOmxAGTBiKxNOINa1aZpaNYkcnTH4a2r+
xe/9qReGzEcEHwjQJ/Ktnoj7AQAA
--------------090203020600020104020707--

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Fri Sep 01 22:13:14 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 06 Sep 2006 - 11:39:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.