在常规Rstudio .r脚本中标记代码块

Tom*_*Tom 4 r rstudio

.rmd使用脚本窗口左下角的小下拉菜单,Rstudio中的文档很容易导航到各种代码块.

在常规.r文件中,函数列出了一个有用的"f"图标,函数名称和注释的块也列出了一个有用的"#"图标,但旁边有(无标题).

我需要在评论中包含哪些内容,以便将"(无标题)"替换为标签?

例:

#----------------------------------------------------
# FirstLabel - This is the first chunk of code I want to navigate to.
#----------------------------------------------------
Run Code Online (Sandbox Code Playgroud)

Dav*_*urg 5

####在要列出的每条评论的末尾添加

# FirstLabel - This is the first chunk of code I want to navigate to. ####
Run Code Online (Sandbox Code Playgroud)

关于这一点的好处是你可以使用评论左侧的下拉箭头隐藏这些评论之间的所有内容