[Rd] unlist preserve common class?

2022-12-08 Thread Spencer Graves
Consider: > str(unlist(list(Sys.Date( num 19334 > str(unlist(list(factor('a' Factor w/ 1 level "a": 1 I naively expected "str(unlist(list(Sys.Date(" to return an object of class 'Date'. After some thought, I felt a need to ask this list if they think that the core R langu

Re: [Rd] unlist preserve common class?

2022-12-08 Thread Gabriel Becker
Hi Spencer, My 2c. According to the docs, factors are special-cased. Other S3 'classes' could be special-cased, such as Date in your example, I suppose, but it is not clear how what you're describing could be implemented for the general case. Suppose I define an S3 "class" called my_awesome_clas

Re: [Rd] unlist preserve common class?

2022-12-08 Thread Spencer Graves
Hi, Gabriel: On 12/8/22 8:20 PM, Gabriel Becker wrote: Hi Spencer, My 2c. According to the docs, factors are special-cased. Other S3 'classes' could be special-cased, such as Date in your example, I suppose, but it is not clear how what you're describing could be implemented for the genera