errorist

Project Status: Active - The project has reached a stable, usable state and is being actively developed. Travis-CI Build Status CRAN_Status_Badge CRAN RStudio mirror downloads Coverage Status

errorist: one who holds to and propagates error

Merriam Webster

The goal of errorist is to automatically search errors and warnings the second they arise.

Installation

The errorist package is only available on GitHub for the moment. You can install the errorist package with:

devtools::install_github("coatless/errorist")

Usage

library(errorist)

Details

When the errorist package is loaded, two handlers are automatically established to intercept the error and warning messages that arise during execution of code. The intercepted messages are then directed to pre-specified search engines on the internet using the user’s preferred system web browser. By default, the search engine used to look up the messages is Google.

You can specify a different search engine handler by setting default values:

If frequent use of the package occurs, consider adding the different search handlers as an option in your .Rprofile:

# Add custom options
.First <- function() {
  options(
    errorist.warning = searcher::google,
    errorist.error = searcher::google
  )
}

# Load the package if in RStudio or R GUI
if (interactive()) {
  suppressMessages(require(errorist))
}

Motivation

The idea for errorist came from a conversation among Dirk Eddelbuettel, Barry Rowlingson, and myself musing about having compilers provide a link explaining what the error meant and how to solve it. This conversation was sprouted due to the mouse overtext of XKCD Comic 1185: Ineffective Sorts.

StackSort connects to StackOverflow, searches for ‘sort a list’, and downloads and runs code snippets until the list is sorted.

This type of code search was implemented by:

https://gkoberger.github.io/stacksort/

The idea morphed from evaluating random code chunks to providing search support for errors that occurred at runtime.

Special Thanks

License

GPL (>= 2)