printString: Print string

View source: R/printString.R

printStringR Documentation

Print string

Description

Capture print() output as a character string.

Usage

printString(x, ..., max = getOption(x = "max.print", default = 100L))

Arguments

x

An object used to select a print() method.

...

Passthrough arguments to print().

max

integer(1). Maximum length of vector. Works internally by calling head() on the print capture, prior to collapse using paste().

Details

Useful for returning informative messages inside a function.

Value

character(1).

Note

Updated 2021-02-23.

See Also

cat().

Examples

printString(c("hello", "world"))
printString(datasets::mtcars, max = 2L)

acidgenomics/AcidBase documentation built on Nov. 29, 2022, 7:39 a.m.