Skip to content

Instantly share code, notes, and snippets.

@dakl
Created July 22, 2008 11:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dakl/830 to your computer and use it in GitHub Desktop.
Save dakl/830 to your computer and use it in GitHub Desktop.
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],
ties = mean)$y
}
y
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment