R/fit_spline_model.R

Defines functions fit_spline_model

fit_spline_model <- function(dat, formula, algorithm){
  if (algorithm == "lm"){
    fitResult <- try(lm(formula, data = dat), silent = TRUE)
  } else if (algorithm == "rlm"){ # Current algorithm for TPP-2D data fitting -> to do: re-use for TPP-2D fits.
    fitResult <- try(rlm(formula, data = dat, maxit = 50), silent = TRUE)
  }
  return(fitResult)
}
DoroChilds/TPP documentation built on Oct. 31, 2021, 4:38 a.m.