gtsummary icon indicating copy to clipboard operation
gtsummary copied to clipboard

Add a `suppressWarnings()` in `tidy_gam()`

Open larmarange opened this issue 3 years ago • 0 comments
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

larmarange avatar Sep 23 '22 08:09 larmarange