scales (version 0.4.0)

wrap_format: Wrap text to a specified width, adding newlines for spaces if text exceeds the width

Description

Wrap text to a specified width, adding newlines for spaces if text exceeds the width

Usage

wrap_format(width)

Arguments

width
value above which to wrap

Value

Function with single parameter x, a character vector, that returns a wrapped character vector

Examples

Run this code
wrap_10 <- wrap_format(10)
wrap_10('A long line that needs to be wrapped')

Run the code above in your browser using DataCamp Workspace