Learn R Programming

assertive.base (version 0.0-9)

safe_deparse: Safe version of deparse

Description

A version of deparse that is guaranteed to always return a single string.

Usage

safe_deparse(expr, ...)

Arguments

expr

Any R expression.

...

Passed to deparse.

Value

A character vector or length one.

Examples

Run this code
# NOT RUN {
# safe_deparse only differs from deparse when the deparse string is longer
# than width.cutoff
deparse(CO2, width.cutoff = 500L) # has length 6
safe_deparse(CO2)                 # has length 1
# }

Run the code above in your browser using DataLab