wrap: Wrap a String

Description Usage Arguments Examples

View source: R/wrap.R

Description

This function operates similarily to strwrap, but pastes the wrapped text back together with line separators. Useful for automatically wrapping long labels.

Usage

1
wrap(x, width = 8, ...)

Arguments

x

A character vectors, or an object which can be converted to a character vector by as.character.

width

A positive integer giving the number of characters a line can reach before we wrap and introduce a new line.

...

Optional arguments passed to strwrap.

Examples

1
2
long_label <- "This is a very long label which needs wrapping."
wrap(long_label)

Kmisc documentation built on May 29, 2017, 1:43 p.m.

Related to wrap in Kmisc...