tidyverse

How to split a string column by length

Intro This is a documentation of how I split a string type column by its length, and combine them together in a directory format (which was a necessary step for me to check whether each directory existed in my analysis). library(tidyverse) data <- tibble(string = c("123456", "987654")) print(data) ## # A tibble: 2 x 1 ## string ## <chr> ## 1 123456 ## 2 987654 Step 1 strsplit splits the string into a list of strings, and in tibble it will show up as a column of list type.