-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
60 lines (44 loc) · 1.53 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# demotivr
<!-- badges: start -->
<!-- badges: end -->
demotivr allows the user to display random nihilistic and generally depressing messages after an error.
## Installation
You can install demotivr from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("joranE/demotivr")
```
## Usage
demotivr provides a way to display periodic demotivational messages on the console whenever an error occurs.
You enable this behavior by setting `options("error")` to:
``` r
options(error = demotivr::nothing_matters)
```
in your .Rprofile. The frequency with which demotivational messages are triggered can be controlled by setting
the `demotivr.abuse_level` option, also in your .Rprofile:
``` r
options(demotivr.abuse_level = 0.5)
```
If unset (or if not set to a number between 0 and 1) it will default to 0.1.
After this setup, running code that triggers an error will randomly display an additional message:
``` r
> log("a")
Error in log("a") : non-numeric argument to mathematical function
You are never more alone than when you are debugging.
```
## Related Work
If abuse is something you seek out, you can also check out the function `demotivate()`
in the package [dang](https://cran.r-project.org/web/packages/dang/index.html).
Remember, nothing matters!