79412168

Date: 2025-02-04 15:18:23
Score: 0.5
Natty:
Report link

data.table as of v1.16.0 now allows for the following:

dt[, names(.SD) := lapply(.SD, fx)]

and

dt[, names(.SD) := lapply(.SD, fx), .SDcols = is.numeric].

So, you could run:

dt[ , names(.SD) := lapply(.SD, "*", -1), .SDcols = cols]

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: chandler