knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

deparse

AppVeyor Build Status

Travis Build Status

The goal of the deparse package is to provide an extensible deparsing function for R. Like base::deparse() and others, the output is intended to produce results that are (almost) identical to the input when evaluated. Unlike the base equivalents, deparse aims at making the output as human-friendly as possible.

The deparse() function is rougly equivalent to deparse(), but with nicer defaults. The deparsec() function returns an object which can be passed to eval() but also retains the desired formatting---a better dput().

Examples

devtools::load_all()
deparse(1)
deparsec(1L)
deparsec(Sys.time())
deparsec(print)

eval(deparsec(print))

Compare this to the dput() output:

deparse(1)
dput(1L)
dput(Sys.time())
dput(print)

eval(parse(text = deparse(print)))

Installation

Install via

devtools::install_github("krlmlr/deparse")


krlmlr/deparse documentation built on May 20, 2019, 6:16 p.m.