plot_label_splitter: Split a long (plot) label into a two-liner

View source: R/plot_label_splitter.R

plot_label_splitterR Documentation

Split a long (plot) label into a two-liner

Description

When a label exceeds the maximum length as defined by the user, the function splits the text/label on the first space after the centre of the string. This is very useful for long labels in a plot

Usage

plot_label_splitter(label, maxlength)

Arguments

label

A character array (the label)

maxlength

When the label exceeds this length, it will be split into a two-line label

Details

The function can be easily applied to a data.frame by using e.g. sapply

Examples

plot_label_splitter("Exotic long label", 10)


inbo/inborutils documentation built on Nov. 23, 2023, 4:42 a.m.