gtsummary
gtsummary copied to clipboard
Add a `suppressWarnings()` in `tidy_gam()`
trafficstars
It could be relevant to add a suppressWarnings() here: https://github.com/ddsjoberg/gtsummary/blob/cf07f8b80ec5d7ffa54b9c48b968aab551ca124f/R/custom_tidiers.R#L257
to avoid warnings in cases like:
mod <- mgcv::gam(response ~ grade, data = gtsummary::trial)
gtsummary::tidy_gam(mod)
#> Warning: Unknown or uninitialised column: `term`.
#> Unknown or uninitialised column: `term`.
#> # A tibble: 3 × 6
#> term estimate std.error statistic p.value parametric
#> <chr> <dbl> <dbl> <dbl> <dbl> <lgl>
#> 1 (Intercept) 0.313 0.0572 5.48 0.000000136 TRUE
#> 2 gradeII -0.0118 0.0822 -0.144 0.886 TRUE
#> 3 gradeIII 0.0199 0.0822 0.242 0.809 TRUE
Created on 2022-09-23 with reprex v2.0.2