labeling folded code chunks in qmd

Hello everyone,

first up, I'm absolutely new to R and to this forum specifically. Just when working on a submission for a statistics seminar, it came across my mind that when working in RStudio with lots of different code chunks I found it useful to fold them to get a better overview. Also labeling the code chunks comes in handy but the only problem seems to be that the respective labels are not visible anymore with folded chunks.
Do you have any idea of a workaround, maybe I oversaw something?

Thank you in advance, I hope I sufficiently used the search function.

All the best regards!

Welcome to the forum.
Just add a label. When you collapse the code chunk you will still see the label.

```{r Addition One}
1 + 1
```

1 Like