The `substr()` function in R is used to extract a substring from a given string. This function takes three arguments: the string to extract from, the starting position of the substring, and the length of the substring. By utilizing `substr()`, you can manipulate character data types effectively, making it easier to perform various string operations such as data cleaning and formatting.
congrats on reading the definition of substr(). now let's actually learn it.