Answers for "split column in r by space"

R
1

how to split a column in r

library(tidyverse)
df <- df %>% separate(old_col_name, c('new_col_1','new_col_2'), extra='drop')
Posted by: Guest on April-08-2021
0

split strings by space in r

unlist(unique(strsplit("This is my test string.", " ")))
[1] "This"    "is"      "my"      "test"    "string."
Posted by: Guest on April-06-2021

Browse Popular Code Answers by Language