11---
2- title : " Working with the errorist package"
3- author : " JJB "
2+ title : " Workflow while using the errorist package"
3+ author : " James Joseph Balamuta "
44date : " `r Sys.Date()`"
55output : rmarkdown::html_vignette
66vignette : >
7- %\VignetteIndexEntry{Working with the errorist package}
7+ %\VignetteIndexEntry{Workflow while using the errorist package}
88 %\VignetteEngine{knitr::rmarkdown}
99 %\VignetteEncoding{UTF-8}
1010---
@@ -16,6 +16,7 @@ knitr::opts_chunk$set(
1616)
1717```
1818
19+ # Overview
1920
2021The ` errorist ` package is designed to provide support for newcomers to _ R_ who
2122are learning how to write code. Philosophically, ` errorist ` takes the position
@@ -25,7 +26,10 @@ These handlers propogate the messages raised by _R_ into the
2526[ ` searcher ` ] ( https://CRAN.R-project.org/package=searcher ) package, which
2627automatically searches the contents on [ Google] ( https://google.com/ ) by default.
2728
28- Thus, to use ` errorist ` in a causal manner, please type:
29+
30+ ## Usage
31+
32+ To use ` errorist ` in a causal manner, please type:
2933
3034``` {r}
3135library(errorist)
@@ -38,3 +42,49 @@ the `disable_errorist()` function or detach the package.
3842detach("package:errorist", unload = TRUE)
3943```
4044
45+ ## Error Search
46+
47+ During development, many issues can arise. With ` errorist ` enabled, each
48+ error is automatically searched. For instance, if we typed a function that
49+ wasn't defined, we'd get:
50+
51+ ``` r
52+ f()
53+ ```
54+
55+ ``` {r, echo = FALSE}
56+ message('Error in f() : could not find function "f"')
57+ message('Searching query in a web browser ... ')
58+ ```
59+
60+ ## Warning Search
61+
62+ Outside of errors, the second most common issue is receiving ** warnings** .
63+ Warnings only indicate a recoverable issue has occurred during a function run.
64+ As a result, there can be many warnings that build up during an estimation routine.
65+ If ` errorist ` is enabled, each unique warning will automatically be searched
66+ within its own tab in the browser. As an example, consider the following function:
67+
68+ ``` r
69+ many_warnings = function () {
70+ warning(" First warning" )
71+ warning(" Second warning" )
72+ warning(" Random warning" )
73+ warning(" Random warning" )
74+ }
75+ ```
76+
77+ This function when run will issue exactly ** four warnings** . However, only
78+ three of these warnings are unique. Thus, there will be exactly ** three**
79+ searches performed after the function finishes its execution.
80+
81+ ``` {r, echo = FALSE}
82+ message("Warning messages:")
83+ message("1: In many_warnings() : First warning")
84+ message("2: In many_warnings() : Second warning")
85+ message("3: In many_warnings() : Third warning")
86+ message("Searching query in a web browser ... ")
87+ message("Searching query in a web browser ... ")
88+ message("Searching query in a web browser ... ")
89+ ```
90+
0 commit comments