Running examples in 'pubh-Ex.R' failed
The error most likely occurred in:

> ### Name: cosm_reg
> ### Title: Cosmetics for tables of regression coefficients. Converts tables
> ###   generated by 'tbl_regression' to 'huxtable' and adds some cosmetics.
> ### Aliases: cosm_reg
> 
> ### ** Examples
> 
> require(sjlabelled, quietly = TRUE)

Attaching package: 'sjlabelled'

The following object is masked from 'package:huxtable':

    set_label

The following object is masked from 'package:ggplot2':

    as_label

> 
> data(diet, package = "Epi")
> diet <- diet %>%
+   var_labels(
+     chd = "Coronary Heart Disease",
+     fibre = "Fibre intake (g/day)"
+   )
> 
> model_binom <- glm(chd ~ fibre, data = diet, family = binomial)
> 
> model_binom %>%
+   tbl_regression(exponentiate = TRUE) %>%
+   cosm_reg(bold = TRUE) %>%
+   theme_pubh(1) %>%
+   add_footnote(get_r2(model_binom), font_size = 9)
               ──────────────────────────────────────────────────
                 Variable             OR       95% CI   p-value  
               ──────────────────────────────────────────────────
                 Fibre intake       0.33   0.15, 0.66     0.001  
                 (g/day)                                         
               ──────────────────────────────────────────────────
                 Tjur's R2 = 0.028                               

Column names: label, estimate, ci, p.value
> 
> data(birthwt, package = "MASS")
> birthwt <- birthwt %>%
+   mutate(
+     smoke = factor(smoke, labels = c("Non-smoker", "Smoker")),
+     race = factor(race, labels = c("White", "African American", "Other"))
+   ) %>%
+   var_labels(
+     bwt = "Birth weight (g)",
+     smoke = "Smoking status",
+     race = "Race"
+   )
> 
> model_norm <- lm(bwt ~ smoke + race, data = birthwt)
> 
> model_norm %>%
+   tbl_regression() %>%
+   cosm_reg(bold = TRUE) %>%
+   theme_pubh(1) %>%
+   add_footnote(get_r2(model_norm), font_size = 9)
Error in stringi::stri_width(x) : 
  bytes encoding is not supported by this function
Calls: <Anonymous> ... to_screen.huxtable -> character_matrix -> ncharw -> <Anonymous>
Execution halted