You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example below has two identical regression models: one with covariate mpg and the other miles per gallon. The covariate with with spaces in the name incorrectly has a header row added.
library(broom.helpers)
# header row incorrectly added when MPG has spaces in the variable name
lm(hp~`miles per gallon`,
mtcars %>% dplyr::rename(`miles per gallon`=mpg)) %>%
tidy_plus_plus(add_header_rows=TRUE)
#> # A tibble: 2 x 16#> term variable var_label var_class var_type var_nlevels header_row contrasts#> <chr> <chr> <chr> <chr> <chr> <int> <lgl> <chr> #> 1 <NA> miles p~ miles pe~ numeric continu~ NA TRUE <NA> #> 2 `mil~ miles p~ miles pe~ numeric continu~ NA FALSE <NA> #> # ... with 8 more variables: reference_row <lgl>, label <chr>, estimate <dbl>,#> # std.error <dbl>, statistic <dbl>, p.value <dbl>, conf.low <dbl>,#> # conf.high <dbl># correct behaviour when using original `mpg` variable name
lm(hp~mpg, mtcars) %>%
tidy_plus_plus(add_header_rows=TRUE)
#> # A tibble: 1 x 16#> term variable var_label var_class var_type var_nlevels header_row contrasts#> <chr> <chr> <chr> <chr> <chr> <int> <lgl> <chr> #> 1 mpg mpg mpg numeric continu~ NA NA <NA> #> # ... with 8 more variables: reference_row <lgl>, label <chr>, estimate <dbl>,#> # std.error <dbl>, statistic <dbl>, p.value <dbl>, conf.low <dbl>,#> # conf.high <dbl>
The example below has two identical regression models: one with covariate
mpg
and the othermiles per gallon
. The covariate with with spaces in the name incorrectly has a header row added.Created on 2020-10-27 by the reprex package (v0.3.0)
The text was updated successfully, but these errors were encountered: