Skip to content
Prev 302467 / 398506 Next

issue with nzchar() ?

Liviu:

Well, as usual, to a certain extent this is arbitrary and the only
issue is whether it is documented correctly.

To me, NA (of whatever mode) means ""indeterminate" or "unknown," so
since "" is known and of length 0, I would have expected NA as a
return. But the point is, not what our particular tastes are ("You say
'tomayto', I say 'tomahto,' an old song goes), but what the docs say.
And in both cases, they tell you exactly what you'll get.

For nchar(): " an integer vector giving the sizes of each element,
currently always 2 for missing values (for NA)"

and for nzchar: "a logical vector of the same length as x, true if and
only if the element has non-zero length." (note the 'only if').

So I see no error or inconsistencies anywhere.

-- Bert
On Mon, Aug 6, 2012 at 7:53 AM, Liviu Andronic <landronimirc at gmail.com> wrote: