format_names_for_plotting.Rd
Wrap long names over multiple lines so that they will look better on plots.
format_names_for_plotting(chars, width = 40, truncate_at = 80)
a character vector (or a variable that can be converted to one)
Positive integer giving target line width (in number of characters). A width less than or equal to 1 will put each word on its own line.
max character length
a reformatted character vector of the same length as the input.
chars <- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer
ac arcu semper erat porttitor egestas. Etiam sagittis, sapien at mattis."
format_names_for_plotting(chars)
#> [1] "Lorem ipsum dolor sit amet, consectetur\n adipiscing elit. Integer ac arcu se..."