Skip to contents

Function for penalized spline-based smoothing using GAM, for use by fun_correct_drift

Usage

fun_gam_smooth(tbl, ref_qc_types, log_transform_internal = TRUE, ...)

Arguments

tbl

Table (tibble or data.frame) containing the fields qc_type, x (run order number), and y (variable)

ref_qc_types

QC types used for the smoothing (fit) by GAM

log_transform_internal

Apply log transformation internally for smoothing if TRUE (default). This does not affect the final data, which remains untransformed.

...

Additional arguments forwarded to mgcv::gam

Value

List with a data.frame containing original x and the smoothed y values, and a boolean value indicating whether the fit failed or not.