- Learning Shiny
- Hernán G. Resnizky
- 596字
- 2021-07-09 21:46:09
About RStudio
As with other programming languages, there is a huge variety of IDEs available for R. IDEs are applications that make code development easier and clearer for the programmer. RStudio is one of the most important ones for R, and it is especially recommended to write web applications in R with Shiny because this contains features specially designed for this purpose. Additionally, RStudio provides facilities to write C++, Latex, or HTML documents and also integrates them to the R code.
RStudio also provides version control, project management, and debugging features among many others.
Installing RStudio
RStudio for desktop computers can be downloaded from its official website at http://www.rstudio.com/products/rstudio/download/ where you can get versions of the software for Windows, MAC OS X, Ubuntu, Debian, and Fedora.
A quick guide to RStudio
Before installing and running RStudio, it is important to have R installed. As it is an IDE and not the programming language, it will not work at all. The following screenshot shows RStudio's starting view:

At the first glance, the following four main windows are available:
- Text editor: This provides facilities to write R scripts such as highlighting and a code completer (when hitting Tab, you can see the available options to complete the code written). It is also possible to include R code in an HTML, Latex, or C++ piece of code.
- Environment and history: They are defined as follows:
- In the Environment section, you can see the active objects in each environment. By clicking on Global Environment (which is the environment shown by default), you can change the environment and see the active objects. You can find more information about environments in a chapter dedicated to this topic in the book Advanced R, by Hadley Wickham. It is available at http://adv-r.had.co.nz/Environments.html.
- In the History tab, the pieces of codes executed are stored line by line. You can select one or more lines and send them either to the editor or to the console. In addition, you can look up for a certain specific piece of code by typing it in the textbox in the top right part of this window.
- Console: This is an exact equivalent of R console, as described in Quick guide of R.
- Tabs: The different tabs are defined as follows:
- Files: This consists of a file browser with several additional features (renaming, deleting, and copying). Clicking on a file will open it in editor or the Environment tab depending on the type of the file. If it is a
.rda
or.RData
file, it will open in both. If it is a text file, it will open in one of them. - Plots: Whenever a plot is executed, it will be displayed in that tab.
- Packages: This shows a list of available and active packages. When the package is active, it will appear as clicked. Packages can also be installed interactively by clicking on Install Packages.
- Help: This is a window to seek and read active packages' documentation.
- Viewer: This enables us to see the HTML-generated content within RStudio.
- Files: This consists of a file browser with several additional features (renaming, deleting, and copying). Clicking on a file will open it in editor or the Environment tab depending on the type of the file. If it is a
Along with numerous features, RStudio also provides keyboard shortcuts. A few of them are listed as follows:

The following screenshots show how a block of code can be collapsed by clicking on the arrow and how it can be accessed quickly by clicking on its name in the bottom-left part of the window:

Clicking on the circled arrow will collapse the Section 1
block, as follows:

The full list of shortcuts can be found at https://support.rstudio.com/hc/en-us/articles/200711853-Keyboard-Shortcuts.
Note
For further information about other RStudio features, the full documentation is available at https://support.rstudio.com/hc/en-us/categories/200035113-Documentation.
- Advanced Quantitative Finance with C++
- vSphere High Performance Cookbook
- Nginx Essentials
- Symfony2 Essentials
- 一塊面包板玩轉(zhuǎn)Arduino編程
- 大話Java:程序設(shè)計從入門到精通
- OpenStack Networking Essentials
- JavaScript+jQuery網(wǎng)頁特效設(shè)計任務(wù)驅(qū)動教程
- 零基礎(chǔ)學(xué)HTML+CSS
- Android Studio開發(fā)實戰(zhàn):從零基礎(chǔ)到App上線 (移動開發(fā)叢書)
- Drupal 8 Development:Beginner's Guide(Second Edition)
- Docker:容器與容器云(第2版)
- Flink核心技術(shù):源碼剖析與特性開發(fā)
- Spring Boot從入門到實戰(zhàn)
- JavaScript Concurrency