Steven Sanderson looks for a sub-string:
When working with text data in R, one common task is to check if a character or substring is present within a larger string. R offers multiple ways to accomplish this, ranging from base R functions to packages like
stringr
andstringi
. In this post, we’ll explore how to usegrepl()
from base R,str_detect()
fromstringr
, andstri_detect_fixed()
fromstringi
to achieve this.
Click through for three separate ways of doing this.