R - nzchar(): find non empty strings

25 Dec 2018

nzchar: find out if elements of a character vector are non-empty string

x <- c("asfef", "", "()", "", NA, "hello")
nzchar(x)
# [1]  TRUE FALSE  TRUE FALSE  TRUE  TRUE
[ R  function  string  ]