An .rmd
document in Rstudio is easy to navigate to the various code chunks using the little drop down in the bottom left corner of the script window.
In a regular .r
file, functions are listed with a helpful 'f' icon and the function name and commented chunks are also listed with a helpful '#' icon, but with (untitled) next to them.
What do I need to include in my comment so the "(untitled)" will be replaced with a label?
example:
#----------------------------------------------------
# FirstLabel - This is the first chunk of code I want to navigate to.
#----------------------------------------------------
Add ####
at the end of every comment you want to list
# FirstLabel - This is the first chunk of code I want to navigate to. ####
The nice thing about this is that you can hide everything between these comments using the drop down arrow on the left of the comment