Created
July 13, 2024 19:12
-
-
Save njudd/fbe7114bc82aa0e368b7f7f315b86577 to your computer and use it in GitHub Desktop.
Quickly split a char vector based on a pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(purrr); library(stringr) | |
map_chr(str_split(df$col2, ", "), 1) # the number indicates the vec you want based on the split |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment