Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nchar() applied to an element with value NA #5

Open
komwomak opened this issue Aug 13, 2020 · 1 comment
Open

nchar() applied to an element with value NA #5

komwomak opened this issue Aug 13, 2020 · 1 comment

Comments

@komwomak
Copy link

komwomak commented Aug 13, 2020

The text at the start of section 7.1 and the example do not appear to agree on what nchar() does on encountering NA:

text <- c("one", "two", "three", NA, "five")
nchar(text)
[1] 3 3 5 NA 4

Thank you for making this material available!

@Ax3man
Copy link

Ax3man commented Nov 24, 2021

It used to be true, but is no longer. This behavior changed around R 3.2.0 and is controlled by the keepNA parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants