Re: [Rd] nchar( NA )

From: Hadley Wickham <hadley_at_rice.edu>
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

Hadley

-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
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 https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive