Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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.

Note

By default the RStudio IDE truncates output in the console at 1000 characters. Consequently, if you use safe_deparse on large or complex objects, you won't see the full value. You can change the setting using Tools -> "Global Options..." -> Code -> Display -> Console -> "Limit length of lines displayed in console to:".

Examples

# 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

assertive.base

A Lightweight Core of the 'assertive' Package

v0.0-9
GPL (>= 3)
Authors
Richard Cotton [aut, cre], Sunkyu Choi [trl], Ivanka Skakun [trl], Gergely Dar<c3><b3>czi [trl], Anton Antonov [trl], Hisham Ben Hamidane [trl], Anja Billing [trl], Aditya Bhagwat [trl], Rasmus B<c3><a5><c3><a5>th [trl], Mine Cetinkaya-Rundel [trl], Aspasia Chatziefthymiou [trl]
Initial release
2021-02-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.