Learn R Programming

report (version 0.1.0)

format_text: Format text

Description

Format text

Usage

format_text(x, sep = ", ", last = " and ", width = NULL)

Arguments

x

Character vector.

sep

Separator.

last

Last separator.

width

Positive integer giving the target column for wrapping lines in the output. Can be "auto".

Value

A formatted character vector.

Examples

Run this code
# NOT RUN {
format_text(c("A", "B", "C"))

x <- paste(rep("a very long string", 50), collapse = " ")
cat(format_text(x, width = 50))
# }

Run the code above in your browser using DataLab