Movatterモバイル変換


[0]ホーム

URL:


errorist

R-CMD-checkCRAN_Status_BadgeCRAN RStudio mirror downloads

errorist: one who holds to and propagates error

MerriamWebster

The goal oferrorist is to automatically search errorsand warnings the second they arise.

Installation

Theerrorist package is available on both CRAN andGitHub. The CRAN version is considered stable while the GitHub versionis in a state of development and may break. You can install the stableversion of theerrorist package with:

install.packages("errorist")

For the development version, you can opt for:

if(!requireNamespace("remotes")) {install.packages("remotes") }remotes::install_github("coatless-rpkg/errorist")

Usage

library(errorist)

Details

When theerrorist package is loaded, two handlers areautomatically established to intercept the error and warning messagesthat arise during execution of code. The intercepted messages are thendirected to pre-specified search engines on the internet using theuser’s preferred system web browser. By default, the search engine usedto look up the messages is Google.

You can specify a different search engine handler by setting defaultvalues:

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

# Add custom options.First<-function() {options(errorist.warning = searcher::search_google,errorist.error = searcher::search_google  )}# Load the package if in RStudio or R GUIif (interactive()) {suppressMessages(require(errorist))}

Motivation

The idea forerrorist came from a conversation amongDirk Eddelbuettel,Barry Rowlingson, and myselfmusing about having compilers provide a link explaining what the errormeant and how to solve it. This conversation was sprouted due to themouse overtext ofXKCD Comic 1185:Ineffective Sorts.

StackSort connects to StackOverflow, searches for ‘sort a list’, anddownloads 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 providingsearch support for errors that occurred at runtime.

Special Thanks

License

GPL (>= 2)


[8]ページ先頭

©2009-2025 Movatter.jp