Winsorizing across all columns in a data frame (R) using `lapply`
问题 I am trying to apply the Winsorize() function using lapply from the library(DescTools) package. What I currently have is; data$col1 <- Winsorize(data$col1) Which essentially replaces the extreme values with a value based on quantiles, replacing the below data as follows; > data$col1 [1] -0.06775798 **-0.55213508** -0.12338265 [4] 0.04928349 **0.47524313** 0.04782829 [7] -0.05070639 **-112.67126382** 0.12657896 [10] -0.12886632 > Winsorize(data$col1) [1] -0.06775798 **-0.37884540** -0.12338265