EmilHvitfeldt / extrasteps

More Steps for the 'recipes' Package
https://emilhvitfeldt.github.io/extrasteps/
Other
6 stars 1 forks source link

add step_sqrt_signed #54

Open EmilHvitfeldt opened 1 year ago

EmilHvitfeldt commented 1 year ago

In much the same way step_log() has a signed argument, I think step_sqrt() should as well. A signed sqrt() would uphold the ordering of near-zero values better then what signed log would do

values <- c(-3 ^ seq(5, -3, by = -0.1), 0, 3 ^ seq(-3, 5, by = 0.1))

plot(values)

plot(sign(values) * log(abs(values)))

plot(sign(values) * sqrt(abs(values)))

Created on 2022-03-26 by the reprex package (v2.0.1)