An open API service indexing awesome lists of open source software.

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

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

[![Travis Build Status](https://travis-ci.org/aviralg/contractr.svg?branch=master)](https://travis-ci.org/aviralg/contractr)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/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
```