Steven Sanderson does a bit of splitting:
Splitting numbers into individual digits can be a handy trick in data analysis and manipulation. Today, we’ll explore how to achieve this using base R functions, specifically
gsub()
andstrsplit()
. Let’s walk through the process step by step, explain the syntax of each function, and provide some examples for clarity.
Click through for a pair of examples.