line_wrap: Function to add new line charter to a character string

View source: R/line_wrap.R

line_wrapR Documentation

Function to add new line charter to a character string

Description

Useful to wrap labels on several lines. Wrap on word breaks. A factor returs factor.

Usage

line_wrap(x, line_lenght = 40)

## Default S3 method:
line_wrap(x, line_lenght = 40)

## S3 method for class 'factor'
line_wrap(x, line_lenght)

Arguments

x

A character string or vector.

line_lenght

A max row lenght (default = 40).

Examples

ggplot(mtcars, aes(x = wt, y=mpg)) + geom_point() +
  ggtitle(line_wrap("This is a unneccessary long example title to show
  how line_wrap function works"))

pttry/ggptt documentation built on May 4, 2023, 2:48 p.m.