From @pencer@gr@ve@ @end|ng |rom e||ect|vede|en@e@org  Fri Dec  9 01:12:34 2022
From: @pencer@gr@ve@ @end|ng |rom e||ect|vede|en@e@org (Spencer Graves)
Date: Thu, 8 Dec 2022 18:12:34 -0600
Subject: [Rd] unlist preserve common class?
Message-ID: <1de177a0-7373-d878-7edd-411fd53aa2fc@effectivedefense.org>

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 language might benefit from modifying 
the language so "str(unlist(list(Sys.Date())))" was of class 'Date', at 
least as an option.


	  Comments?
	  Thanks,
	  Spencer Graves


 > sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 11.7.1

Matrix products: default
LAPACK: 
/Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_4.2.2 tools_4.2.2



[Rd] unlist preserve common class?
Spencer Graves