Skip to content

Commit

Permalink
build_readme()
Browse files Browse the repository at this point in the history
  • Loading branch information
romainfrancois committed Apr 20, 2024
1 parent 2017bdf commit b8fe283
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pak::pak("tadascience/slap")
library(dplyr)
library(slap)
boom <- function() stop("ouch")
boom <- function() stop("An error occured in boom()")
# instead of:
withCallingHandlers(
Expand All @@ -48,5 +48,9 @@ withCallingHandlers(
)
# just use the slap operator, i.e. %!%
summarise(mtcars, mpg = boom()) %!% "ouch"
summarise(mtcars, mpg = boom()) %!% "ouch"
# or use the double slap operator for simpler error
# i.e. without keeping the parent error
summarise(mtcars, mpg = boom()) %!!% "ouch"
```
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pak::pak("tadascience/slap")
library(dplyr)
library(slap)

boom <- function() stop("ouch")
boom <- function() stop("An error occured in boom()")

# instead of:
withCallingHandlers(
Expand All @@ -39,5 +39,9 @@ withCallingHandlers(
)

# just use the slap operator, i.e. %!%
summarise(mtcars, mpg = boom()) %!% "ouch"
summarise(mtcars, mpg = boom()) %!% "ouch"

# or use the double slap operator for simpler error
# i.e. without keeping the parent error
summarise(mtcars, mpg = boom()) %!!% "ouch"
```

0 comments on commit b8fe283

Please sign in to comment.