break_str: Insert line breaks into character strings

Description Usage Arguments Value Author(s) Examples

View source: R/utils.R

Description

By default, all the non-alphanumeric characters are replaced by '\n', which can be useful when plotting long axis labels, e.g., in parallel coordinates plots.

Usage

1
break_str(x, split = "[^[:alnum:]]", ...)

Arguments

x

a character vector

split

the rule (regular expression) to replace characters by line breaks

...

other arguments passed to gsub

Value

a character vector with certain characters replaced by '\n'

Author(s)

Yihui Xie <http://yihui.name>

Examples

1
2
break_str(c("long label1.1", "long label1.2", "long label1.3"), split = " ")
break_str(names(iris))

ggobi/cranvas documentation built on May 17, 2019, 3:10 a.m.