作者clansoda (小笨)
看板R_Language
標題Re: [問題] 分割data.frame裡的文字(像excel資料剖析)
時間Wed Mar 14 10:58:14 2018
Hi,如果你熟悉data.table的基本語法的話 他提供一個很快的方法
mystring <- "123,123,123"
dt <- data.table(target = mystring)
dt[, c("first", "second", "third") := tstrsplit(target, ",")]
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.232.146.246
※ 文章網址: https://webptt.com/m.aspx?n=bbs/R_Language/M.1520996299.A.67A.html
1F:推 a3236852: 沒錯~~這就是我要的,太感謝你了!!!! 03/14 11:19