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

https://github.com/eachanjohnson/errR

Graceful error handling in R
https://github.com/eachanjohnson/errR

error-handling graceful

Last synced: 4 months ago
JSON representation

Graceful error handling in R

Awesome Lists containing this project

README

        

[![Build Status](https://travis-ci.org/eachanjohnson/errR.svg?branch=master)](https://travis-ci.org/eachanjohnson/errR)

# errR
`errR` is a minimal framework which wraps R's `tryCatch` into a system of binary operators to make defensive programming more succinct and readable.

## Installation

Not yet on CRAN. Install using `devtools`:

`devtools::install_github('eachanjohnson/errR')`

## Usage
Currently supports two related idioms:

` %except% `

` %except% `

In an interactive R session, try:

`stop('This is an error!')`

Then compare with:

`stop('This is an error!') %except% print('Error, but continuing anyway')`

See how this compares to:

`stop('This is an error!') %except% print`

## To do

- Handle warnings
- Add `%finally%` operator