Re: [Rd] as.character(list(NA))

2018-01-22 Thread Hervé Pagès
onday, January 22, 2018 2:01 PM To: William Dunlap mailto:wdun...@tibco.com>>; Patrick Perry mailto:ppe...@stern.nyu.edu>> Cc: r-devel@r-project.org <mailto:r-devel@r-project.org> Subject: Re: [Rd] as.character(list(NA)) On 01/20/2018 08:24 AM, William Dunlap

Re: [Rd] as.character(list(NA))

2018-01-22 Thread William Dunlap via R-devel
- > From: R-devel [mailto:r-devel-boun...@r-project.org] On Behalf Of Hervé > Pagès > Sent: Monday, January 22, 2018 2:01 PM > To: William Dunlap ; Patrick Perry < > ppe...@stern.nyu.edu> > Cc: r-devel@r-project.org > Subject: Re: [Rd] as.character(list(NA)) > > On 0

Re: [Rd] as.character(list(NA))

2018-01-22 Thread Robert McGehee
-devel [mailto:r-devel-boun...@r-project.org] On Behalf Of Hervé Pagès Sent: Monday, January 22, 2018 2:01 PM To: William Dunlap ; Patrick Perry Cc: r-devel@r-project.org Subject: Re: [Rd] as.character(list(NA)) On 01/20/2018 08:24 AM, William Dunlap via R-devel wrote: > I believe that f

Re: [Rd] as.character(list(NA))

2018-01-22 Thread Hervé Pagès
On 01/20/2018 08:24 AM, William Dunlap via R-devel wrote: I believe that for a list as.character() applies deparse() to each element of the list. deparse() does not preserve NA-ness, as it is intended to make text that the parser can read. str(as.character(list(Na=NA, LglVec=c(TRUE,NA), Func

Re: [Rd] as.character(list(NA))

2018-01-20 Thread William Dunlap via R-devel
I believe that for a list as.character() applies deparse() to each element of the list. deparse() does not preserve NA-ness, as it is intended to make text that the parser can read. > str(as.character(list(Na=NA, LglVec=c(TRUE,NA), Function=function(x){x+1}))) chr [1:3] "NA" "c(TRUE, NA)" "func

Re: [Rd] as.character(list(NA))

2018-01-20 Thread Dirk Eddelbuettel
On 20 January 2018 at 10:43, Patrick Perry wrote: | As of R Under development (unstable) (2018-01-19 r74138): | | > as.character(list(NA)) | [1] "NA" | | > is.na(as.character(list(NA))) | [1] FALSE Are you aware that this is the same in R-release, and might be "on purpose" ? R> R.Version()$v

[Rd] as.character(list(NA))

2018-01-20 Thread Patrick Perry
As of R Under development (unstable) (2018-01-19 r74138): > as.character(list(NA)) [1] "NA" > is.na(as.character(list(NA))) [1] FALSE __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel