Skip to content

Instantly share code, notes, and snippets.

View dakl's full-sized avatar
💌
ML Engineer @ Epidemic Sound

Daniel Klevebring dakl

💌
ML Engineer @ Epidemic Sound
  • Epidemic Sound
  • Stockholm
View GitHub Profile
# This function takes A and M-values (or any X and Y )
lowessNormalization <- function(x, y, include = TRUE, line = NULL,
...) {
isFinite <- (is.finite(x) & is.finite(y))
if (any(isFinite)){
if (is.null(line)) {
line <- lowess(x[isFinite & include], y[isFinite &
include], ...)
}
y[isFinite] <- y[isFinite] - approx(line, xout = x[isFinite],