Learn R Programming

BBmisc (version 1.13)

printToChar: Prints object to a string / character vector.

Description

Prints object to a string / character vector.

Usage

printToChar(x, collapse = "\n")

Value

[character].

Arguments

x

[any]
Object to print

collapse

[character(1)]
Used to collapse multiple lines. NULL means no collapsing, vector is returned. Default is “\n”.

Examples

Run this code
x = data.frame(a = 1:2, b = 3:4)
str(printToChar(x))

Run the code above in your browser using DataLab