keepNA in nchar and nzchar

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

keepNA in nchar and nzchar

R devel mailing list
Is it intended that in yesterday's version of R-devel the default value of
keepNA is different in nchar (NA) and nzchar (FALSE)?

  > args(nchar)
  function (x, type = "chars", allowNA = FALSE, keepNA = NA)
  > args(nzchar)
  function (x, keepNA = FALSE)

Is it intended that for keepNA=NA, nchar and nzchar do not
give concordant results?

  > vapply(c(TRUE, FALSE, NA), function(keepNA) nchar(NA_character_,
keepNA=keepNA), FUN.VALUE=integer(1))
  [1] NA  2 NA
  > vapply(c(TRUE, FALSE, NA), function(keepNA) nzchar(NA_character_,
keepNA=keepNA), FUN.VALUE=logical(1))
  [1]   NA TRUE TRUE

> version$version.string
[1] "R Under development (unstable) (2016-03-15 r70334)"

Bill Dunlap
TIBCO Software

        [[alternative HTML version deleted]]

[hidden email] mailing list