Skip to contents

This function inserts a new line into a string when it exceeds a user-specified length. New lines are added to spaces in the string. This is intended to make plot legends more readable and tidy.

Usage

TADA_InsertBreaks(x, len = 50)

Arguments

x

A vector of strings

len

The maximum character length a string can be before the function searches for the best space to insert a new line.

Value

The same vector of strings with new lines added where appropriate.