EmilHvitfeldt / extrasteps

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

step_denoise() #50

Open EmilHvitfeldt opened 1 year ago

EmilHvitfeldt commented 1 year ago
denoise <- function(x, amount = 1) {
  floor(x * (1/amount)) * amount
}

aaa <- rnorm(100)

plot(aaa, denoise(aaa, 0.2))

Created on 2022-10-31 with reprex v2.0.2