Closed wvictor14 closed 1 month ago
Howdy!
This is an error at the fmt_fn
argument level.
The default is:
fmt_fn = scales::label_number(scale_cut = cut_short_scale(), trim = TRUE)
If we apply that to your values:
scales::label_number(scale_cut = cut_short_scale(), trim = TRUE)(c(158500, 21300))
Error in `break_suffix[bad_break][improved_break & !power10_break] <- names(lower_break[improved_break & !power10_break])`:
! NAs are not allowed in subscripted assignments
If you adjust the fmt_fn=
to be something scales::label_number_auto()
then you will get a working table.
tibble(x = list(c(158500, 21300))) |>
gt() |>
gt_plt_bar_stack(x, fmt_fn = scales::label_number_auto())
I noticed that one (maybe more?) rows of my data cause this error.
Am not sure why this particular set of numbers causes an error:
reprex:
Error: