glue
glue copied to clipboard
More control over width in glue_collapse
Ideally, if width was set it would only show complete items, and there would be an option to show how many were omitted
x <- c("1234567890")
# Instead of:
glue::glue_collapse(rep(x, 2), sep = ", ", width = 20)
#> 1234567890, 12345...
# it would be nice to have:
#> 1234567890, ...
# And an option that did this:
glue::glue_collapse(rep(x, 10), sep = ", ", width = 20, and = "and {n} more")
#> 1234567890, and 9 more
Yeah this is similar to https://github.com/tidyverse/glue/issues/104
No longer needed, since cli handles this.