wrap_text: Produce a nicely-wrapped paragraph for console printing

Description Usage Arguments Value Examples

View source: R/console_output.R

Description

Wrapping text needs to be done separately from actually printing it with stop or warning or message. This is because these functions typically also print some information about the environment where they were called.

Usage

1

Arguments

...

Vectors to be coerced to Character.

Value

The text in ... will be collapsed and wrapped.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
wrapped <- 
wrap_text(
    "Lorem ipsum dolor sit amet, ornare justo condimentum",
    "et sit lorem! Himenaeos, vel et sodales sit.",
    "Eu nulla. Magna ullamcorper nascetur placerat platea.\n\n",
    "Eleifend semper velit sed aliquam, ut ligula non commodo.")

cat(wrapped)

#>  Lorem ipsum dolor sit amet, ornare justo condimentum et sit lorem! 
#>  Himenaeos, vel et sodales sit. Eu nulla. Magna ullamcorper 
#>  nascetur placerat platea. 
#>
#>  Eleifend semper velit sed aliquam, ut ligula non commodo.

## End(Not run)

librarian documentation built on July 12, 2021, 5:07 p.m.