printStrToChar {BBmisc}R Documentation

Print str(x) of an object to a string / character vector.

Description

Print str(x) of an object to a string / character vector.

Usage

printStrToChar(x, collapse = "\n")

Arguments

x

[any]
Object to print

collapse

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

Value

[character].

Examples

printStrToChar(iris)
## [1] "'data.frame':\t150 obs. of  5 variables:\n $ Sepal.Length: num  5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ...\n $ Sepal.Width : num  3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ...\n $ Petal.Length: num  1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ...\n $ Petal.Width : num  0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ...\n $ Species     : Factor w/ 3 levels \"setosa\",\"versicolor\",..: 1 1 1 1 1 1 1 1 1 1 ..."

[Package BBmisc version 1.7 Index]