Applying a function to each row of a data.table

前端 未结 7 1312
日久生厌
日久生厌 2020-12-03 10:46

I looking for a way to efficiently apply a function to each row of data.table. Let\'s consider the following data table:

library(data.table)
library(stringr)         


        
7条回答
  •  北荒
    北荒 (楼主)
    2020-12-03 11:08

    x[, .(a,strsplit(b,' ')), by = .I]
    

    looks more estetic

提交回复
热议问题