deparse_onestring: Deparse and then concatenate into a single string

View source: R/fixes_for_builtins.R

deparse_onestringR Documentation

Deparse and then concatenate into a single string

Description

This is like the base R deparse(), except that it always returns a single string, rather than a character vector of lines of text.

Usage

deparse_onestring(...)

Arguments

...

See deparse().

Value

A character vector of length 1.

Note that depending on the different deparse options, the resulting string may still not be a complete R expression that recreates the original object. Also note that the returned string may contain newlines.

Examples


# Make an object whose representation spans multiple lines
x <- seq(100)[-50]
length(deparse(x))
length(deparse_onestring(x))
identical(x, eval(parse(text=deparse_onestring(x))))


DarwinAwardWinner/rctutils documentation built on July 22, 2022, 5:19 a.m.