We could use cSplit
from splitstackshape
library(splitstackshape)
library(data.table)
cSplit(setDT(df)[, lapply(.SD, gsub, pattern = "[][}]",
replacement = "")], names(df), sep=",", fixed = FALSE, "long")
# Col_A Col_B Col_C
#1: 0.1 1.54e+12 1
#2: 0.5 1.54e+12 3
#3: 0.7 1.54e+12 4
#4: NA NA 5
data
df <- structure(list(Col_A = "[0.1,0.5,0.7]", Col_B = "[1.54E12, 1.54E12, 1.54E12]",
Col_C = "[1, 3, 4, 5}"), class = "data.frame", row.names = c(NA,
-1L))
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…