splitLongWords: Split long words

splitLongWordsR Documentation

Split long words

Description

Takes a vector of words (character strings) and splits each word longer than the specified length (in characters) using separators passed as a regular expression.

Usage

splitLongWords(
  words,
  width,
  separators = "[,;:/\\?\\!\\-\\%]",
  NAstring = "NA"
)

Arguments

words

a character vector.

width

integer; maximal width (in characters) of a word.

separators

character string with a regular expression.

NAstring

character string, NA value replacement The word is cut *after* each occurrence of the pattern.

Value

an updated character vector.


Roche/ggtips documentation built on May 14, 2022, 12:44 p.m.