searcher: Generate a Searcher function for use with Error Handling

Description Usage Arguments Details Generic Error Search Examples

View source: R/search-functions.R

Description

Constructs a function object that will search the last R error message on search portals by opening a browser.

Usage

1
searcher(site, keyword = getOption("searcher.default_keyword"))

Arguments

site

Name of site to search on. Supported options: "google" (default), "bing", "duckduckgo", "startpage", "rstudio community", "twitter","stackoverflow", "github", and "bitbucket".

keyword

Opt to search under different default terms.

Details

This function acts as a closure. Thus, you will receive a function back when only specifying the site parameter. To call the function, add a second set of parentheses.

Generic Error Search

The searcher function grabs the last error message and tries to search it. This function will ensure that R language is the primary search context.

Examples

1
2
3
4
5
6
7
8
9
### Manually
searcher("google")()

## Not run: 
### Automatically
# On error, automatically search the message on google
options(error = searcher("google"))

## End(Not run)

searcher documentation built on July 25, 2021, 1:06 a.m.