Question: what is nchar in r?
Answer: nchar takes a character vector as an argument and returns a vector whose elements contain the sizes of the corresponding elements of x . Internally, it is a generic, for which methods can be defined. nzchar is a fast way to find out if elements of a character vector are non-empty strings.