https://github.com/krlmlr/deparse
A nicer deparse
https://github.com/krlmlr/deparse
Last synced: 4 months ago
JSON representation
A nicer deparse
- Host: GitHub
- URL: https://github.com/krlmlr/deparse
- Owner: krlmlr
- Archived: true
- Created: 2016-08-16T15:10:18.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-22T14:08:14.000Z (almost 8 years ago)
- Last Synced: 2024-08-13T07:15:27.112Z (8 months ago)
- Language: R
- Homepage:
- Size: 42 KB
- Stars: 12
- Watchers: 2
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
Awesome Lists containing this project
- jimsghstars - krlmlr/deparse - A nicer deparse (R)
README
---
output: github_document
---```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```# deparse
[](https://ci.appveyor.com/project/krlmlr/deparse)
[](https://www.travis-ci.org/krlmlr/deparse)
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
```{r echo=FALSE, message=FALSE}
devtools::load_all()
``````{r}
deparse(1)
deparsec(1L)
deparsec(Sys.time())
deparsec(print)eval(deparsec(print))
```Compare this to the `dput()` output:
```{r}
deparse(1)
dput(1L)
dput(Sys.time())
dput(print)eval(parse(text = deparse(print)))
```## Installation
Install via
```r
devtools::install_github("krlmlr/deparse")
```