Guest User

Untitled

a guest
Feb 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. # This function takes A and M-values (or any X and Y )
  2. lowessNormalization <- function(x, y, include = TRUE, line = NULL,
  3. ...) {
  4. isFinite <- (is.finite(x) & is.finite(y))
  5. if (any(isFinite)){
  6. if (is.null(line)) {
  7. line <- lowess(x[isFinite & include], y[isFinite &
  8. include], ...)
  9. }
  10. y[isFinite] <- y[isFinite] - approx(line, xout = x[isFinite],
  11. ties = mean)$y
  12. }
  13.  
  14. y
  15. }
Add Comment
Please, Sign In to add comment