r - R 文件内的目录/索引

标签 r rstudio

我有一个很长的 R 脚本文件(其中一个有 2723 行),我可以创建目录或索引来浏览文件吗?

我想创建一个指向文本中特定行的目录,假设我有 20 个变量要分析,一个目录将包含 20 个项目。

最佳答案

您可以使用 CTRL 插入部分+ SHIFT + R (Cmd + Shift + R 在 Mac 上)

有关更多详细信息,请参阅Code Folding and Sections

Code Folding RStudio supports both automatic and user-defined folding for regions of code. Code folding allows you to easily show and hide blocks of code to make it easier to navigate your source file and focus on the coding task at hand.

...

To navigate between code sections you can use the Jump To menu available at the bottom of the editor:

enter image description here

关于r - R 文件内的目录/索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22647591/

相关文章:

r - 如何在 RStudio 中为不同版本的 R 设置快捷方式?

r - 使用 data.table 在多次熔化期间命名变量

r - data.table 中的唯一标识符

r - 如何在R中绘制能量图中的曲线?

r - GAM 中的时间自相关

knitr - 是否可以在 Rstudio 的查看器而不是新生成的 Rstudio 预览窗口中查看我的 HTML 文件?

linux - 在 debian9 上从源 Rstudio Desktop 安装,错误 cmake

sql-server - 与 SQL Server(和 Sybase 12.5)的 DBI 连接不返回希腊字符

r - MATLAB 绘图函数类似于 Lattice 包中的 xyplot()

r - 折叠 R-Studio 脚本中的所有函数