newline_format: Insert a newline between words so that all single lines will...

View source: R/utilities.R

newline_formatR Documentation

Insert a newline between words so that all single lines will be of length 'len' or less.

Description

Insert a newline between words so that all single lines will be of length 'len' or less.

Usage

newline_format(x, len)

Arguments

x

string to insert newlines into

len

length that each line must be

Value

string with newlines inserted

Examples

str <- "This is a test of the newline_format function which is used to split text"
newline_format(str, 12)

pbs-assess/herringutils documentation built on Jan. 10, 2025, 8:43 a.m.