check if a character is in string R code example
Example 1: how to check if its a character in r
a = "test"
is.character(a)
# TRUE
Example 2: checking if a substring exists in a string r
grepl(regex, string_to_search)
a = "test"
is.character(a)
# TRUE
grepl(regex, string_to_search)