Main menu

Handling and processing strings in R using the stringr package

In this tutorial, I will be touching on how to manipulate strings in R using specifically the stringr package. This tutorial assumes that you have a basic understanding of R, and it is not supposed to be a introduction to using R. While string manipulation might sound like an irrelevant topic, when doing data analysis, from time to time, you may need to deal with it to get better result for your analysis. There are not be a lot of tutorials out there on manipulating strings in R. This tutorial touches on some of the functions that you might find yourself using on a regular basis for manipulating strings.

The tutorials covers:

Converting strings to lowercase, uppercase and capitalising the first letter of every word in R

Finding a pattern in a string

Creating suplicates for a string

Ordering and sorting strings in R

Counting the number of characters, word, sentence and line breaks in a string in R