I'm using RScript files, haven't yet made the leap to RMarkdown. I am trying to stay organized with my notes and code, and use the outline heavily.
As such, my code looks like this. Essentially:
#Main Subject Heading 1
##Sub Heading 1 which is meant to be nested under Main Subject Heading 1----
# Info for sub heading 1
# Info for sub heading 1
# Info for sub heading 1
##Sub Heading 2 which is meant to be nested under Main Subject Heading 1----
# Info for sub heading 2
# Info for sub heading 2
#Main Subject Heading 2----
##Sub Heading 1 which is meant to be nested under Main Subject Heading 2----
This visually looks correct in the outline; the sub headings are indented under the main headings. However, if I try to collapse the main subject heading, it only collapses info under that MSH up until sub heading 1, and I have to collapse each sub-heading separately.
Is there a way in R Script files to make it so that collapsing the Main Subject Heading will also collapse all nested sections? In searching for nesting-related codes I'm just finding functions relating to actually nesting data frames and the like.