Search code examples
rstudio

Setting title for code line in RStudio


I use RStudio.

The default title of each line is "Untitled" as you can see in the first picture. enter image description here

Today, I found that the title of each line can be modified. As we can see, the title in the second picture is different. enter image description here

But I don't know how to set the title. Can anyone tell me how to do it? Thank you very much!! :-)


Solution

  • This is either the section name (if it has an orange #) or the function name (if it has a blue f).

    You can define sections with

    ## Section name ----
    

    or

    ## Section name ====
    

    or

    ## Section name ####
    

    See the documentation here.