-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.qmd
1177 lines (755 loc) · 22.5 KB
/
index.qmd
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
title: "Debugging"
author: "Shannon Pileggi"
footer: "[Debugging](https://github.com/shannonpileggi/iterating-well-with-purrr)"
logo: "img/wtf-logo-square-transparent.png"
format:
revealjs:
theme: [night, slides.scss]
highlight-style: a11y
transition: fade
slide-number: true
chalkboard: true
editor: source
execute:
freeze: auto
---
# Agenda
Getting started
Troubleshooting
Moving on
Debugging your code
Debugging in RStudio
Debugging their code
Special cases
Read the source
# Getting started
```{r}
library(countdown)
```
```{r font-awesome-color}
# fill for font awesome icons
fa_fill <- "#C7B41D"
```
## About
**Licensing**
This work is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/) (CC BY-SA4.0).
<br> <br>
**Material**
This material was originally developed as part of the 2-day RStudio Conference
["What They Forgot To Teach You About R"](https://rstats-wtf.github.io/wtf-2022-rsc/){target="_blank"} workshop.
## Checklist
<br>
`r fontawesome::fa("check", fill = fa_fill)` R installed?
Pretty recent?
Recommended R ≥ 4.2.0
`r fontawesome::fa("check", fill = fa_fill)` RStudio installed?
I'm on 2022.02.3+492
`r fontawesome::fa("check", fill = fa_fill)` Ready to build packages?
`devtools::has_devel()`<br> *Your system is ready to build packages!*
## Additional resources {.smaller}
- WTF Ch 11 *Debugging R code* <br> <https://rstats.wtf/debugging-r-code.html>
- Advanced R Ch 22 *Debugging* <br> <https://adv-r.hadley.nz/debugging.html>
- Jenny Bryan 2020 RStudio Conf Keynote *Object of type closure is not subsettable* <br> <https://github.com/jennybc/debugging#readme>
- Amanda Gadrow 2018 Webinar *Debugging techniques in RStudio* <br> <https://www.rstudio.com/resources/webinars/debugging-techniques-in-rstudio/>
- Jim Hester 2019 *Introduction to debugging in R and RStudio* <br> <https://www.jimhester.com/talk/2019-crug-debugging/>
- Maëlle Salmon 2021 *How to become a better R code detective?* <br> <https://masalmon.eu/2021/07/13/code-detective/>
- Kara Woo 2019 RStudio Conf *Box plots A case study in debugging and perseverance* <https://www.rstudio.com/resources/rstudioconf-2019/box-plots-a-case-study-in-debugging-and-perseverance/>
::: footer
:::
##
```{r, out.width="20%"}
#| fig.alt: >
#| A cartoon of a fuzzy round monster face showing 10 different emotions experienced during the process of debugging code. The
#| progression goes from (1) “I got this” - looking determined and optimistic; (2) “Huh. Really thought that was it.” - looking a bit
#| baffled; (3) “...” - looking up at the ceiling in thought; (4) “Fine. Restarting.” - looking a bit annoyed; (5) “OH WTF.” Looking very
#| frazzled and frustrated; (6) “Zombie meltdown.” - looking like a full meltdown; (7) (blank) - sleeping; (8) “A NEW HOPE!” - a happy
#| looking monster with a lightbulb above; (9) “insert awesome theme song” - looking determined and typing away; (10) “I love coding” -
#| arms raised in victory with a big smile, with confetti falling.
knitr::include_graphics("img/debugging.jpg")
```
::: footer
Artwork by [\@allison_horst](https://twitter.com/allison_horst).
<https://github.com/allisonhorst/stats-illustrations>
:::
# Troubleshooting
## 1. Search
<br>
- Google *exact* error message
- keyword search on [RStudio community](https://community.rstudio.com/)
- keyword search on [stackoverflow](https://stackoverflow.com/), `[r]` tag
Samantha Csik 2022 R-Ladies St. Louis Workshop *Teach Me How To Google*: [slides](https://samanthacsik.github.io/teach-me-how-to-google/slides/RLadiesSTL-2022-02-22.html#1), [recording](https://youtu.be/93WsFQUuxvA)
## 2. Reset {.smaller}
<brshort>
::: r-fit-text
Have you tried turning it `OFF` and `ON` again?
:::
. . .
<brshort>
::: r-fit-text
Restart R, especially when things get weird.
:::
. . .
::: columns
::: {.column width="50%"}
Session -\> Restart R or
- Ctrl + Shift + F10 (Windows),
- Cmd + Shift + 0 / Cmd + Shift + F10 (Mac)
:::
::: {.column width="50%"}
`Tools -> Global Options -> Workspace`
![](img/workspace-options.PNG)
:::
:::
::: footer
:::
## Your turn, exercise 00
[Click here to open the NHS-R RStudio Cloud debugging work space.](https://rstudio.cloud/spaces/293870/join?access_code=5lSkhQedDhpg6X-KDU0j433JgYYpIsz1YZaLGXBU){target="_blank"}
<brshort>
::: question
In RStudio Cloud, set your Workspace options as shown.
:::
`Tools -> Global Options -> Workspace`
::: columns
::: {.column width="50%"}
![](img/workspace-options.PNG)
:::
:::
```{r}
countdown(
minutes = 3,
# Fanfare when it's over
play_sound = TRUE,
# Set timer theme to match solarized colors
color_border = "#FFFFFF",
color_text = "#7aa81e",
color_running_background = "#7aa81e",
color_running_text = "#FFFFFF",
color_finished_background = "#ffa07a",
color_finished_text = "#FFFFFF",
font_size = "2em",
)
```
## 3. Reprex
::: r-fit-text
minimum `repr`oducible `ex`ample
:::
::: columns
::: {.column width="45%"}
![](img/reprex-logo.png)
:::
::: {.column width="55%"}
<br> <br> <https://reprex.tidyverse.org/>
:::
:::
<brshort>
::: footer
*make a reprex..... please* by Sharla Gelfand (2021)
slides: <https://make-a-reprex-please.netlify.app/#1>
recording: <https://www.youtube.com/watch?v=G5Nm-GpmrLw>
:::
## minimum
![](img/haystack.PNG){fig-align="center"}
::: footer
Jenny Bryan (2020) *Object of type closure is not subsettable*
<https://github.com/jennybc/debugging>
:::
::: notes
MINIMAL: Don't wring hands and speculate.
Work a small concrete example that reveals, confirms, or eliminates something.
:::
## `repr`oducible `ex`ample
![](img/say_do.PNG){fig-align="center"}
::: footer
Jenny Bryan (2020) *Object of type closure is not subsettable*
<https://github.com/jennybc/debugging>
:::
::: notes
Reproducible example: No reliance on hidden state
:::
## why reprex
![](img/reprex-why.PNG){fig-align="center"}
::: footer
Jenny Bryan (2020) *Object of type closure is not subsettable*
<https://github.com/jennybc/debugging>
:::
## Review
<br>
Troubleshooting strategies:
<br>
1. Search
2. Reset
3. Reprex
## But what if
![](img/swat-bugs.gif)
::: footer
<https://giphy.com/gifs/TreehouseDirect-agent-binky-8UabbehIqkR0akDt1y>
:::
# Moving on
<br>
::: r-fit-text
from troubleshooting to...
:::
<brshort>
::: r-fit-text
formal `debugging` techniques.
:::
## Key concepts
<br>
`r fontawesome::fa("road", fill = "white")` traceback
`location` where did the error occur
<br>
`r fontawesome::fa("bug", fill = "white")` interactive debugger
`context` why did the error occur
<br>
`r fontawesome::fa("magnifying-glass", fill = "white")` your code vs `r fontawesome::fa("hat-wizard", fill = "white")` their code
::: notes
interactive debugging: pause the execution of a function and launch environment where you can interactively explore what's happening
:::
## Debugging tools
![](img/debugging_tools.svg)
::: notes
source for image in google slides at
https://docs.google.com/presentation/d/14mqGirw4TnblqSFY0Tk30YrxkAwIrz1xo4nMIwgqk_o/edit?u
sp=sharing
:::
##
::: r-fit-text
This is a lot.
:::
. . .
<br>
These tools achieve similar objectives slightly differently.
<br>
People don't generally use *all* of these tools at once.
They pick and choose the ones they like.
## Sourcing
<br>
⚠️ name your script with functions
<brshort>
⚠️ source your script with functions
<brshort>
for the best debugging experience 😎
<br>
![](img/source-marked.jpg)
## Set up
<br>
```{r, echo = TRUE, error = TRUE}
f <- function(x) {
x + 1
}
g <- function(x) f(x)
g("a")
```
# Debugging your code
## print()
```{r, eval=TRUE, echo=TRUE, error=TRUE, `code-line-numbers`="2"}
f <- function(x) {
print(x)
x + 1
}
g <- function(x) f(x)
```
```{r, eval=TRUE, echo=TRUE, error=TRUE, `code-line-numbers`="2"}
g("a")
```
::: notes
Insert numerous print statements to precisely locate the problem, and see the values of important variables.
Print debugging is slow and primitive, but it always works.
Can provide location by inserting print statements in different places, can provide context by seeing values.
can assess `location` by where `print` statement is inserted
can assess `context` by value printed
`non-interactive` debugging
good for `your code`
:::
## cat()
```{r, eval=TRUE, echo=TRUE, error=TRUE, `code-line-numbers`="2-3"}
f <- function(x) {
cat("f()\n")
cat("x =", x, "\n")
x + 1
}
g <- function(x) f(x)
g("a")
```
::: notes
can assess `location` by where `print` statement is inserted
can assess `context` by value printed
`non-interactive` debugging
good for `your code`
print is handy to see full object; cat is handy to create smaller messages
:::
## traceback()
<br>
```{r, eval=FALSE, echo=TRUE, error = TRUE, `code-line-numbers`="3"}
source("demo/my_functions.R")
g("a")
traceback()
```
![](img/traceback.PNG)
<br>
shows the sequence of calls that lead to the error.
::: notes
used interactively in console, called for last error observed
:::
::: footer
the trace back is also known as: <br> call stack, stack trace, & back trace
:::
## Richer traceback
<br>
```{r, eval=FALSE, echo=TRUE, error = TRUE, `code-line-numbers`="2,4"}
source("demo/my_functions.R")
options(error = rlang::entrace)
g("a")
rlang::last_error()
```
![](img/rlang_last-error.PNG)
## Richer traceback
<br>
```{r, eval=FALSE, echo=TRUE, error = TRUE, `code-line-numbers`="5"}
source("demo/my_functions.R")
options(error = rlang::entrace)
g("a")
rlang::last_error()
rlang::last_trace()
```
![](img/rlang_last-trace.PNG)
<br>
`options(error = rlang::entrace)` <br> could go in your `.Rprofile`
## traceback vs rlang functions
<br>
Numbering and ordering differs between `traceback()` and rlang functions.
<brshort>
![](img/traceback-ordering.PNG)
::: footer
<https://adv-r.hadley.nz/debugging.html#call-stack-ordering>
:::
## browser()
```{r, eval=FALSE, echo=TRUE, `code-line-numbers`="2"}
f <- function(x) {
browser()
x + 1
}
g <- function(x) f(x)
```
<br>
`browser()` opens the interactive debugger.
1. Modify the function by inserting a `browser()` statement.
2. Source the function.
3. Execute the function.
## Interactive debugger
![](img/interactive-debugger.PNG)
## Interactive debugger tips
<br>
::: columns
::: {.column width="35%"}
Investigate objects
<br>
<br>
Control execution
:::
::: {.column width="5%"}
:::
::: {.column width="55%"}
`ls()`, `ls.str()`,<br> `str()`, `print()`
<br>
::: small
| command | operation |
|---------|----------------------------------------|
| `n` | next statement |
| `c` | continue (leave interactive debugging) |
| `s` | step into function call |
| `f` | finish loop / function |
| `where` | show previous calls |
| `Q` | quit debugger |
:::
:::
:::
## Debugging your code
![](img/debugging_yours.svg)
## Your turn, exercise 01
[Click here to open the NHS-R RStudio Cloud debugging work space.](https://rstudio.cloud/spaces/293870/join?access_code=5lSkhQedDhpg6X-KDU0j433JgYYpIsz1YZaLGXBU){target="_blank"}
<brshort>
::: question
Complete 01_exercise to practice debugging your own code.
:::
::: small
Check out the `README.md` for some getting started tips!
- `01_debugging_spartan.R` (directions to explore without suggested code)
- `01_debugging_comfy.R` (directions to explore with suggested code)
- `01_debugging_solution.R` (directions to explore with code solutions)
:::
```{r}
countdown(
minutes = 15,
# Fanfare when it's over
play_sound = TRUE,
# Set timer theme to match solarized colors
color_border = "#FFFFFF",
color_text = "#7aa81e",
color_running_background = "#7aa81e",
color_running_text = "#FFFFFF",
color_finished_background = "#ffa07a",
color_finished_text = "#FFFFFF",
font_size = "2em",
)
```
::: footer
<https://github.com/rstats-wtf/wtf-debugging>
:::
# Debugging in RStudio
## Editor breakpoints
red circle = breakpoint = `browser()`
(but you don't have to change your code)
![](img/breakpoint.PNG)
. . .
Set / re-set an editor breakpoint:
- click to the left of the line number in the source file
- press Shift+F9 with your cursor on the line
## Editor breakpoints
red circle = breakpoint = `browser()`
(but you don't have to change your code)
![](img/breakpoint.PNG)
To activate, either
- click IDE Source button, or
- `debugSource(`"demo/my_functions.R"`)`
## Debugging console
![](img/cheatsheet-debug-console.PNG)
::: footer
RStudio IDE cheatsheet
<https://www.rstudio.com/resources/cheatsheets/>
:::
## IDE on error
::: columns
::: {.column width="45%"}
Automatically invoke actions on error.
![](img/IDE_debug_menu_crop.png)
:::
::: {.column .fragment width="55%"}
New set up for demonstration.
```{r, echo=TRUE, eval=TRUE, error=TRUE}
f <- function(x) { strsplit(x, ",") }
g <- function(x) { f(x) }
g("a,b")
```
<br>
::: fragment
```{r, echo=TRUE, eval=TRUE, error=TRUE}
g(factor("a,b"))
```
:::
:::
:::
## IDE message only
<br>
![](img/IDE_message-only.PNG)
## IDE error inspector
<br>
![](img/IDE_error-inspector.PNG)
## IDE break in code
<br>
![](img/IDE_break-in-code.PNG)
## Error inspector
::: columns
::: {.column width="58%"}
```{r, echo=TRUE, eval=FALSE}
# IDE Error Inspector not triggered
f <- function(x) x + 1
g <- function(x) f(x)
g("a")
# IDE Error Inspector not triggered
strsplit(factor("a,b"), ",")
# IDE Error Inspector not triggered
f <- function(x) strsplit(x, ",")
f(factor("a,b"))
# IDE Error Inspector yes triggered
g <- function(x) f(x)
g(factor("a,b"))
```
:::
::: {.column width="5%"}
:::
::: {.column width="35%"}
<br> The error inspector is only invoked if `your` `code` is involved.
:::
:::
::: footer
To have RStudio invoke the debugger on any error,
`Tools -> Global Options`
*uncheck* `Use debug error handler only when my code contains errors.`
:::
## Debugging in the RStudio IDE
![](img/debugging_ide.svg)
## Your turn, exercise 02
<br>
::: question
Complete 02_exercise to practice debugging a slightly different version of your own code, using features from the RStudio IDE.
:::
```{r}
countdown(
minutes = 7
)
```
::: footer
<https://github.com/rstats-wtf/wtf-debugging>
:::
# Debugging their code
## debug()
`debug()` = `browser()`/ `breakpoint` in first line of function
```{r, eval=FALSE, echo=TRUE,`code-line-numbers`="4,7"}
# source if code is yours, otherwise not necessary
source("demo/my_functions.R")
# set debugging flag
debug("g")
g("a")
# turn off debugging flag
undebug("g")
```
. . .
- interactive debugger is initiated every time `g()` is executed, until `undebug("g")`
- depending on function internals, this can... trap you in the debugger 😬
## debugonce()
`debugonce()` = `browser()`/ `breakpoint` in first line of function
```{r, eval=FALSE, echo=TRUE,`code-line-numbers`="4"}
# source if code is yours, otherwise not necessary
source("demo/my_functions.R")
# set debugging flag
debugonce("g")
g("a")
```
- one time only!
- interactive debugger initiated a **single** time when `g()` is executed
## options(error = recover)
`r fontawesome::fa("check", fill = fa_fill)` we already discussed <br> `options(error = rlang::entrace)`<br> for a richer traceback on error
<br>
🤠 `options(error = recover)`
1. displays an interactive prompt with frames
2. you select the frame to enter the debugger
## recover example
```{r, eval=FALSE, echo=TRUE,`code-line-numbers`="2"}
source("demo/my_functions.R")
options(error = recover)
g("a")
options(error = NULL)
```
<br>
![](img/options-error-recover.PNG)
## trace() overview
`trace(what = fun, tracer = browser)` <br> is equivalent to
- inserting `browser()` in first line of function
- `debug(fun)`
. . .
you an also insert *any* code at *any* location in function
- `trace(what = fun, tracer = browser, at = 2)` <br>inserts `browser()` at second step of `fun`
. . .
`untrace(fun)` cancels the tracing
::: notes
`trace()` is a more flexible version of `debug()`
⚠️ `trace()` requires `{` in function definition
:::
## trace() without a specified step
<br>
```{r, eval=FALSE, echo=TRUE,`code-line-numbers`="1,4"}
trace(what = colSums, tracer = browser)
colSums(1:3)
# ls.str() in browser
untrace(colSums)
```
<br>
`trace(what = colSums, tracer = browser)` <br> is equivalent to
- inserting `browser()` in first line of `colSums` <br> if we had the source code
- `debug(colSums)`
## navigating function steps
<br>
investigate 🧐 the function with `as.list()` + `body()`
<brshort>
```{r, eval=FALSE, echo=TRUE}
x <- as.list(body(colSums))
View(x)
```
<brshort>
. . .
::: columns
::: {.column width="40%"}
![](img/colSums-body.png)
:::
::: {.column width="2%"}
:::
::: {.column width="58%"}
![](img/colSums-list.PNG)
:::
:::
## identify function step
![](img/colSums-list-investigate.PNG)
## trace() at specified step
<br>
```{r, eval=FALSE, echo=TRUE,`code-line-numbers`="7,12"}
# identify spot to insert code
as.list(x[[3]][[1]])
# equivalent notation
as.list(x[[c(3, 1)]])
# insert browser at step 3.1
trace(colSums, browser, at = list(c(3, 1)))
# execute function
colSums(1:3)
# ls.str() handy in browser
# cancel tracing
untrace(colSums)
```
## Debugging their code
![](img/debugging_theirs.svg)
## Your turn, exercise 03
<br>
```{r, eval=FALSE, echo=TRUE}
# already installed in your RStudio Cloud work space
# install.packages("devtools")
# devtools::install_github("rstats-wtf/wtfdbg")
```
<br>
::: question
Complete 03_exercise to practice debugging others' code.
:::
```{r}
countdown(
minutes = 10
)
```
::: footer
<https://github.com/rstats-wtf/wtf-debugging>
:::
## Pick your favorite
![](img/debugging_pick.svg)
# Special cases
## Rmarkdown {.smaller}
<br>
#### Troubleshooting:
1. rmarkdown chunk option `error = TRUE` enables knitting with errors
2. insert `knitr::knit_exit()` and interactively work through .Rmd
. . .
<br>
#### Debugging:
1. Adv R Ch 22.5.3 RMarkdown <https://adv-r.hadley.nz/debugging.html#rmarkdown>
2. WTF Ch 11.4 Debugging in Rmarkdown documents <https://rstats.wtf/debugging-r-code.html#debugging-in-r-markdown-documents>
## Piped expressions
<br>
tracebacks can be verbose with pipes
. . .
<br>
```{r, eval=FALSE, echo=TRUE}
options(error = rlang::entrace, rlang_backtrace_on_error = "branch")
```