Strings in R
Explore fundamental string analysis techniques in R.
Processing string (character) data
String manipulation is ubiquitous in datasets and is a critical skill for analysts to have. Data is often contained within blocks of text, requiring us to tease out the information contained in it with rigorous effort.
A range of techniques for string manipulation exists in data analysis. This lesson focuses on the most widely used methods.
Please note that some of the functions in this lesson come from the stringr
library.
Find the length of strings
Finding the length of strings is helpful in filters and categorization.
There are different ways to see the number of characters in a string.
Both the built-in nchar()
and the str_count()
functions from the stringr
library return the number of characters in a string.
# Use of nchar() function
myString
...