官术网_书友最值得收藏!

  • 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:

A quick guide to RStudio

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.

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:

A quick guide to RStudio

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

A quick guide to RStudio

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.

主站蜘蛛池模板: 江山市| 安仁县| 大洼县| 莆田市| 铜山县| 岚皋县| 泾川县| 永胜县| 韶关市| 榆社县| 高邑县| 长顺县| 泸州市| 军事| 泰兴市| 耿马| 耒阳市| 留坝县| 赤水市| 宁河县| 临汾市| 定襄县| 八宿县| 天峨县| 普安县| 黑山县| 乌兰察布市| 垦利县| 长治市| 彝良县| 天津市| 禹州市| 中西区| 江都市| 舞阳县| 贵州省| 新安县| 大竹县| 邢台县| 香河县| 镇巴县|