1

I see people naming code chunks on R Markdown, for example,

```{r Randomization, eval = T}

```

What is the purpose of including "Randomization" here? It doesn't appear on the knitted PDF file so is that just for me to remember what the codes are for myself?

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
chunguc1004
  • 111
  • 1
  • 3
    A discussion can be found here: https://masalmon.eu/2017/08/08/chunkpets/. If you are using RStudio, you can view the chunk names in outline form and easily jump to them by name: https://stackoverflow.com/questions/60819878/shortcut-to-jump-to-a-chunk-in-r-markdown – MrFlick Feb 10 '23 at 21:23
  • @MrFlick, post as answer? (I find the debugging feature most useful - i.e., when knitting breaks you know immediately where it happened) – Ben Bolker Feb 10 '23 at 22:24

1 Answers1

1

To summarise the comments:

  1. @MrFlick: If you are using RStudio, you can view the chunk names in outline form and easily jump to them by name: Shortcut to jump to a chunk in R Markdown?
  2. @BenBolker: I find the debugging feature most useful - i.e., when knitting breaks you know immediately where it happened
  3. I recently came across chunk embedding concept, see this link by @yihui: https://bookdown.org/yihui/rmarkdown-cookbook/reuse-chunks.html
zx8754
  • 52,746
  • 12
  • 114
  • 209