Suharto Anggono Suharto Anggono
2024-Nov-25 16:38 UTC
[Rd] Alternative to some recently changed parts of dates.R and datetime.R
In?function?'Summary.Date'?in?dates.R?, ..1 could?be?used?instead?of ...elt(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)) Also, the fragment secs <- x$sec[f0]; secs <- secs[is.finite(secs)] could be put inside if(np?>=?1L)
Martin Maechler
2024-Nov-26 09:14 UTC
[Rd] Alternative to some recently changed parts of dates.R and datetime.R
>>>>> 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