我在rstudio进行探索工作,并且经常不应执行我的代码的某个部分。此外,我想避免我的代码部分使我分心。
在Pycharm中,我可以使用IDE的代码折叠可能性。通过交互方式折叠代码(语句(如果语句)单击“减去”按钮)这些目前不需要的东西对我来说是不再可见的。如果需要,如果语句相应,我可以展开该部分并更改。
rstudio是否可以使用类似的东西?
I am working exploratively in RStudio and have quite frequently the situation that a certain part of my code should not be executed. Additionally I want to avoid that this part of my code distracts me.
In Pycharm, I can use the code folding possibilities of the IDE. By folding the code interactively (clicking on the "minus" button at the if
statement) these things that are not needed presently are not visible anymore to me. If needed I can unfold the section and change the if
statement accordingly.


Is there something similar possible with RStudio?
发布评论
评论(2)
是的,我们在 Rstudio 中确实有类似的功能。只要你的代码用大括号
{}
包裹起来,它就可以折叠和展开。展开:
折叠(点击数轴旁边的向下小箭头将其折叠):
只需点击黄色部分即可再次展开
有关 Rstudio 支持页面< /a>.
Yes we do have similar functionality in Rstudio. As long as your code is wrapped with curly bracket
{}
, it can be folded and unfolded.Unfolded:
Folded (click on the little downward arrow next to the number line to fold it):
Just click on the yellow part to expand it again
More information on the Rstudio support page.
如果您没有卷发支架,请在顶部添加评论行,即
If you don't have curly brackets then just add a comment line on top, i.e.