Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to keep folded functions folded when I open my .R file on another device. rStudio

I m going to email my .R codes.
it would be great if my receiver can also open .R file and get my folded functions folded. ( neat and readable )
how is this achieved in Rstudio?

like image 472
Mathica Avatar asked Sep 07 '25 04:09

Mathica


1 Answers

According to code folding in Rstudio

Folded regions are preserved while editing a document; however all foldable regions are shown expanded by default when a file is closed and re-opened.

But, we can use short-cuts as mentioned in the post if we want to expand all/collapse all

Edit -> Folding:

Collapse — Alt+L

Expand — Shift+Alt+L

Collapse All — Alt+O

Expand All — Shift+Alt+O

like image 105
akrun Avatar answered Sep 10 '25 04:09

akrun