larmarange / broom.helpers

A set of functions to facilitate manipulation of tibbles produced by broom
https://larmarange.github.io/broom.helpers/
GNU General Public License v3.0
22 stars 7 forks source link

Warning about missing terms column #175

Closed ddsjoberg closed 2 years ago

ddsjoberg commented 2 years ago

This warning is being printed when I run the R CMD Checks. We should address this. If it's fine, we can add a suppressWarning() or something else?

library(broom.helpers)

mgcv::gam(response ~ grade, data = gtsummary::trial) |> 
  model_identify_variables()
#> Warning: Unknown or uninitialised column: `term`.
#> Unknown or uninitialised column: `term`.
#> # A tibble: 3 × 5
#>   term        variable var_class var_nlevels var_type   
#>   <chr>       <chr>    <chr>           <int> <chr>      
#> 1 (Intercept) <NA>     <NA>               NA intercept  
#> 2 gradeII     grade    factor              3 categorical
#> 3 gradeIII    grade    factor              3 categorical

Created on 2022-09-18 with reprex v2.0.2

larmarange commented 2 years ago

It seems related with a problem with broom.

library(broom.helpers)

mod <- mgcv::gam(response ~ grade, data = gtsummary::trial)

mod |> 
  broom::tidy()
#> Warning: Unknown or uninitialised column: `term`.
#> Unknown or uninitialised column: `term`.
#> # A tibble: 0 × 1
#> # … with 1 variable: term <chr>

Created on 2022-09-19 with reprex v2.0.2

larmarange commented 2 years ago

Sorry, it took me some time to remember GAM models.

We could just use a suppressWarning(). Could I suggest to also add it in gtsummary::tidy_gam()?

ddsjoberg commented 2 years ago

Thanks @larmarange !