Check if Elements of a Vector are non-empty Strings in R Programming - nzchar() Function Last Updated : 01 Jun, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report nzchar() function in R Language is used to test whether elements of a character vector are non-empty strings. Syntax: nzchar(x) Parameters: x: character vector Example 1: Python3 # R program to illustrate # nzchar function # Initializing a character vector x <- c("GFG", "gfg") y <- c("a", "b", "c") # Calling the nzchar() function nzchar(x) nzchar(y) Output : [1] TRUE TRUE [1] TRUE TRUE TRUE Example 2: Python3 # R program to illustrate # nzchar function # Initializing a character vector x <- c("") y <- c("", "") # Calling the nzchar() function nzchar(x) nzchar(y) Output: [1] FALSE [1] FALSE FALSE Comment More infoAdvertise with us Next Article Check if Elements of a Vector are non-empty Strings in R Programming - nzchar() Function K Kanchan_Ray Follow Improve Article Tags : R Language R Vector-Function R String-Functions Similar Reads Seeking a unique match of elements in R Programming - char.expand() Function char.expand() function in R Language is used to seek a unique match of its first argument among the elements of its second. If successful, it returns this element; otherwise, it performs an action specified by the third argument. Syntax: char.expand(input, target, nomatch = stop("no match"))Paramet 1 min read Find String Matches in a Vector or Matrix in R Programming - str_detect() Function str_detect() Function in R Language is used to check if the specified match of the substring exists in the original string. It will return TRUE for a match found otherwise FALSE against each of the element of the Vector or matrix. Note: This function uses 'stringr' Library. Syntax: str_detect(string 2 min read Check if values in a vector are True or not in R Programming - all() and any() Function In this article, we are going to check if the values in a vector are true or not in R Programming Language. R - all() function all() function in R Language will check in a vector whether all the values are true or not. Syntax: all(x, na.rm) Parameters: x: vectorna.rm: logical, if NA value to remov 2 min read Getting Match of an Element within a Vector in R Programming - charmatch() Function charmatch() function in R Programming Language is used to find matches between two arguments. Syntax: charmatch(x, table, nomatch = NA_integer_) Parameters: x: the values to be matchedtable: the values to be matched againstnomatch: the integer value to be returned at non-matching positionr - charma 1 min read Check for the Existence of a Vector Object in R Programming - is.vector() Function is.vector() function in R Language is used to return TRUE if the given vector is of the specified mode having no attributes other than names. It returns FALSE otherwise. Syntax: is.vector(x, mode = "any") Parameters: x: R object mode: character string naming an atomic mode or "list" or "expression" 1 min read Like