From m@ech|er @end|ng |rom @t@t@m@th@ethz@ch  Tue Nov 26 10:14:57 2024
From: m@ech|er @end|ng |rom @t@t@m@th@ethz@ch (Martin Maechler)
Date: Tue, 26 Nov 2024 10:14:57 +0100
Subject: [Rd] Alternative to some recently changed parts of dates.R and
 datetime.R
In-Reply-To: <955678192.2644007.1732552689750@mail.yahoo.com>
References: <955678192.2644007.1732552689750.ref@mail.yahoo.com>
 <955678192.2644007.1732552689750@mail.yahoo.com>
Message-ID: <26437.37265.748554.68672@stat.math.ethz.ch>

>>>>> Suharto Anggono Suharto Anggono via R-devel 
>>>>>     on Mon, 25 Nov 2024 16:38:09 +0000 (UTC) writes:
>>>>> Suharto Anggono Suharto Anggono via R-devel 
>>>>>     on Mon, 25 Nov 2024 16:38:09 +0000 (UTC) writes:

    > In?function?'Summary.Date'?in?dates.R?,
    > ..1
    > could?be?used?instead?of 
    > ...elt(1L)

yes, of course!  (Note that till a few days ago, this was `list(...)[[1L]]` ..)

    > In?function?'format.POSIXlt'?in?datetime.R?,
    > unlist(unclass(x)[1L:3L],?use.names=FALSE)
    > could?be?used?instead?of
    > unlist(`names<-`(unclass(x)[1L:3L],?NULL))

indeed, yes!

    > Also, the fragment
    > secs <- x$sec[f0]; secs <- secs[is.finite(secs)]
    > could be put inside
    > if(np?>=?1L)

the current version of datetime.R  does not contain that any
more ..  and as you've noticed on Bugzilla,  we are still
tweaking the behaviour of  format.POSIXlt() ..

Thank you, very much, Suharto,
for the two small improvements above (committed as svn rev 87382) !!

Martin



[Rd] Alternative to some recently changed parts of dates.R and datetime.R
Martin Maechler