Learn R Programming

multiUS (version 1.2.3)

breakString: Break a string

Description

The function breaks a string after around the specified number of characters.

Usage

breakString(x, nChar = 20)

Value

A string with inserted \n.

Arguments

x

A string.

nChar

The number of characters after which the new line is inserted. Default to 20.

Author

Marjan Cugmas

Examples

Run this code
someText <- "This is the function that breaks a string."
breakString(x = someText, nChar = 20)

Run the code above in your browser using DataLab