polish.Rd
Wrapper around broom::tidy()
with some additional finishing touches!
polish( x, .labels = NULL, .conf_int = TRUE, .flextable = TRUE, .header1 = NULL, .header2 = NULL, ... )
x | A model object to be converted into a |
---|---|
.labels | A named list of variable labels. If NULL, current labels will be used |
.conf_int | Logical to return a 95 percent confidence interval |
.flextable | Logical to return a formatted flextable object if TRUE or a list of a dataframe and row numbers to use in |
.header1 | See |
.header2 | See |
... | additional arguments passed to |
df1 <- tibble::tibble( id = letters, age = sample(seq(18, 39, 1), 26, replace = TRUE), mile_time = sample(seq(6, 7.5, 0.1), 26, replace = TRUE), gender = sample(c("Male", "Female"), 26, replace = TRUE), country = sample(c("USA", "Canada", "Africa", "England"), 26, replace = TRUE) ) lm_res <- lm(mile_time ~ age + gender + country, data = df1) lm_res %>% polish( .labels = c(age = "Age", gender = "Gender", country = "Country of origin"), .header1 = list(values = c("", "Estimate (95% CI)")) )#> a flextable object. #> col_keys: `label_lev`, `Estimate` #> header has 1 row(s) #> body has 6 row(s) #> original dataset sample: #> label_lev Estimate #> 1 Age 0.00 (-0.03, 0.03) #> 2 Gender (Male) -0.30 (-0.76, 0.16) #> 3 Country of origin <NA> #> 4 Canada -0.31 (-0.97, 0.35) #> 5 England -0.45 (-1.05, 0.14)