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 2023-01-30.

Examples

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

acidgenomics/r-acidbase documentation built on Jan. 12, 2024, 3:56 a.m.