knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
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()
.
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)))
Install via
devtools::install_github("krlmlr/deparse")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.