How do I pass column-specific arguments to lapply in data.table .SD?
问题 I have seen examples of using .SD with lapply in data.table with a simple function as below: DT[ , .(b,d,e) := lapply(.SD, tan), .SDcols = .(b,d,e)] But I'm unsure of how to use column-specific arguments in a multiple argument function. For instance I have a winsorize function, I want to apply it to a subset of columns in a data table but using column-specific percentiles, e.g. library(DescTools) wlevel <- list(b=list(lower=0.01,upper=0.99), c=list(upper=0.02,upper=0.95)) DT[ , .(b,c) :