Re: [Rd] nchar( NA )

From: Hadley Wickham <>
Date: Fri, 18 Jun 2010 18:56:00 -0700

> Value:
>     For ‘nchar’, an integer vector giving the sizes of each element,
>     currently always ‘2’ for missing values (for ‘NA’).
> It may be unexpected behavior, but it's *well-documented* unexpected behavior.

Oh, that must make it ok then.

For a more sensible take:

> library(stringr)
> str_length(c("", NA))

[1] 0 NA


Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University

______________________________________________ mailing list
Received on Sat 19 Jun 2010 - 01:59:23 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 19 Jun 2010 - 10:31:09 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive