Running examples in ‘huxtable-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: number_format
> ### Title: Set how numbers are formatted in cells
> ### Aliases: number_format number_format<- set_number_format
> ###   map_number_format
> 
> ### ** Examples
> 
> ht <- huxtable(
+   number_format = c(
+     "Default",
+     "NA",
+     "2",
+     "\"%5.2f\"",
+     "Pretty",
+     "Sign"
+   ),
+   a = rep(1000, 6),
+   b = rep(1000.005, 6),
+   c = rep(0.0001, 6),
+   d = rep(-1, 6),
+   e = rep("3.2 (s.e. 1.4)", 6)
+ )
> 
> number_format(ht)[3, -1] <- NA
> number_format(ht)[4, -1] <- 2
> number_format(ht)[5, -1] <- "%5.2f"
> 
> number_format(ht)[6, -1] <- fmt_pretty()
> 
> number_format(ht)[7, -1] <- list(
+   function(x) if (x > 0) "+" else "-"
+ )
> 
> right_border(ht) <- 1
> bottom_border(ht)[1, ] <- 1
> 
> ht
Error in `stringr::str_replace_all()`:
! Failed to apply `replacement` function.
ℹ It must accept a character vector of any length.
Caused by error in `if (x > 0) ...`:
! the condition has length > 1
Backtrace:
     ▆
  1. ├─base (local) `<fn>`(x)
  2. ├─huxtable:::print.huxtable(x)
  3. │ └─huxtable (local) meth(x, ...)
  4. │   ├─base::cat(to_screen(ht, ...))
  5. │   └─huxtable::to_screen(ht, ...)
  6. │     └─huxtable:::generate_table_display(...)
  7. │       └─huxtable:::create_character_matrix(...)
  8. │         └─huxtable:::character_matrix(...)
  9. │           └─huxtable:::prepare_cell_display_data(ht, markdown)
 10. │             └─huxtable:::clean_contents(ht, output_type = if (markdown) "markdown" else "screen")
 11. │               └─huxtable:::format_numbers_matrix(contents, ht)
 12. │                 └─base::vapply(...)
 13. │                   └─huxtable (local) FUN(X[[i]], ...)
 14. │                     └─base::vapply(...)
 15. │                       └─huxtable (local) FUN(X[[i]], ...)
 16. │                         └─huxtable:::format_numbers(cell, nf[[row, col]])
 17. │                           └─stringr::str_replace_all(string, number_regex(), format_numeral)
 18. │                             └─stringr:::str_transform_all(string, pattern, replacement)
 19. │                               ├─base::withCallingHandlers(...)
 20. │                               └─huxtable (local) replacement(old_flat)
 21. │                                 └─numeral_formatter(num_fmt)(num)
 22. └─base::.handleSimpleError(...)
 23.   └─stringr (local) h(simpleError(msg, call))
 24.     └─cli::cli_abort(...)
 25.       └─rlang::abort(...)
Execution halted