[Rd] as.character.Date() strips names in R 4.3.2 beta, bug?

Andrew Piskorski @tp @end|ng |rom p|@kor@k|@com
Tue Oct 24 06:01:58 CEST 2023


In previous versions of R, as.character.Date() retained any names on
its input vector.  In R 4.3.2 beta, it removes names.  Is this change
intentional, or a bug?  (For what it's worth, I greatly dislike this
change, and hope it gets changed back.)


$ grep DESCRIPTION /etc/lsb-release
DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"
$ R --vanilla
R version 4.2.1 Patched (2022-07-09 r82577) -- "Funny-Looking Kid"
> v2 <- structure(as.Date(c('2021-10-06','2021-10-08')) ,names=c('a','b'))
> v2
           a            b
"2021-10-06" "2021-10-08"
> class(v2)
[1] "Date"
> as.character(v2)
           a            b
"2021-10-06" "2021-10-08"
> as.character.Date(v2)
           a            b
"2021-10-06" "2021-10-08"


$ grep DESCRIPTION /etc/lsb-release
DISTRIB_DESCRIPTION="Ubuntu 22.04.3 LTS"
$ R --vanilla
R version 4.3.2 beta (2023-10-22 r85392) -- "Eye Holes"
> v2 <- structure(as.Date(c('2021-10-06','2021-10-08')) ,names=c('a','b'))
> v2
           a            b
"2021-10-06" "2021-10-08"
> class(v2)
[1] "Date"
> as.character(v2)
[1] "2021-10-06" "2021-10-08"
> as.character.Date(v2)
[1] "2021-10-06" "2021-10-08"

-- 
Andrew Piskorski <atp using piskorski.com>



More information about the R-devel mailing list