https://github.com/aviralg/contractr
Add contracts to R functions using annotations
https://github.com/aviralg/contractr
annotations contracts r
Last synced: over 1 year ago
JSON representation
Add contracts to R functions using annotations
- Host: GitHub
- URL: https://github.com/aviralg/contractr
- Owner: aviralg
- Created: 2017-06-15T12:54:10.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-21T23:48:13.000Z (almost 9 years ago)
- Last Synced: 2025-01-28T03:29:00.068Z (over 1 year ago)
- Topics: annotations, contracts, r
- Language: R
- Homepage:
- Size: 43.9 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
README
---
output:
github_document:
html_preview: false
---
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
options(tibble.print_min = 5, tibble.print_max = 5)
```
# contractr
[](https://travis-ci.org/aviralg/contractr)
[](http://cran.r-project.org/package=contractr)
## Overview
`contractr` processes annotations on function arguments and body and inserts
corresponding contracts in the function body.
Since `GNU R` does not support annotations (yet), this package relies on my own
version of R, `rant`, which extends R to support annotations on functions,
function formals and function body.
## Installation
To install this package you have to install `rant` and `annotatr` packages.
```{bash, eval = FALSE}
git clone https://github.com/aviralg/rant
make -j -C rant
```
```{bash, eval = FALSE}
git clone https://github.com/aviralg/annotatr
rant/bin/R CMD INSTALL annotatr
```
```{bash, eval = FALSE}
git clone https://github.com/aviralg/contractr
rant/bin/R CMD INSTALL contractr
```