Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning RStudio for R Statistical Computing

You're reading from  Learning RStudio for R Statistical Computing

Product type Book
Published in Dec 2012
Publisher Packt
ISBN-13 9781782160601
Pages 126 pages
Edition 1st Edition
Languages
Concepts

Folding, sectioning, and navigation


For easy editing and code inspection, the appearance of code in the editor can be customized. Code folding allows you to temporarily hide user-defined sections or indented blocks (functions, loops, and so on). RStudio also offers shortcuts and menus that allow for quick navigation between blocks and sections.

Code folding

Long scripts with many blocks of code can be hard to read. Often this is an indication that the script should be split into multiple files, but alternatively RStudio has a code folding feature that allows you to collapse blocks of code. All the blocks with curly brackets ({}) and code sections (see the following code snippets) can be folded. All foldable code is preceded with a small triangle. Clicking on the triangle collapses or expands a code block. That a block of code is collapsed can also be seen in the gap of line numbers. Here, the folded/collapsed function, the body of the function at line 5, is collapsed:

Keyboard shortcuts for...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}