15

My Rmarkdown scripts are getting quite large lately. Especially the code inside the R-chunk which makes over-viewing the whole script more and more tricky. Luckily in RStudio there's the functionality to close resp. minimize the code chunk to one line! However when chunks are becoming more, it takes time to close them all by hand.

Question: Is there a feature to close them all at once? Say when starting to work on the script and then reopen single chunks when needed.

PS: Wasn't sure to post this as a feature request on github or here.

andschar
  • 3,504
  • 2
  • 27
  • 35

1 Answers1

17

Edit > Folding > Collapse All

Alternatively, (on Windows) Alt+O.

Dan
  • 11,370
  • 4
  • 43
  • 68
  • thanks wasn't aware of that feature! However, I was wandering if such a feature exists for the code chunks only (This works on chapters). – andschar Aug 22 '17 at 11:27
  • I didn't realise that it collapsed chapters, too. That's the only one I know of, unfortunately. – Dan Aug 22 '17 at 11:32
  • As an aside, Alt + Shift + O reverses it, or Expands All – Microscone Jan 02 '20 at 20:04