split dataframe by column value in R code example
Example 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')
Example 2: r split column by delimiter
within(df, FOO<-data.frame(do.call('rbind', strsplit(as.character(FOO), '|', fixed=TRUE))))