Book Image

Learning RStudio for R Statistical Computing

Book Image

Learning RStudio for R Statistical Computing

Overview of this book

Data is coming at us faster, dirtier, and at an ever increasing rate. The necessity to handle many, complex statistical analysis projects is hitting statisticians and analysts across the globe. This book will show you how to deal with it like never before, thus providing an edge and improving productivity. "Learning RStudio for R Statistical Computing" will teach you how to quickly and efficiently create and manage statistical analysis projects, import data, develop R scripts, and generate reports and graphics. R developers will learn about package development, coding principles, and version control with RStudio. This book will help you to learn and understand RStudio features to effectively perform statistical analysis and reporting, code editing, and R development. The book starts with a quick introduction where you will learn to load data, perform simple analysis, plot a graph, and generate automatic reports. You will then be able to explore the available features for effective coding, graphical analysis, R project management, report generation, and even project management. "Learning RStudio for R Statistical Computing" is stuffed with feature-rich and easy-to-understand examples, through step-by-step instructions helping you to quickly master the most popular IDE for R development.
Table of Contents (13 chapters)

RStudio at a glance


Like R, RStudio is a free and open source project. Founded by JJ Allaire, RStudio is also a company that sells services related to their open source product, such as consulting and training.

RStudio is an Integrated Development Environment (IDE) for R. The term IDE comes from the software industry and refers to a tool that makes it easy to develop applications in one or more programming languages. Typical IDEs offer tools to easily write and document code, compile and perform tests, and offer integration with a version control tool.

RStudio integrates the R environment, a highly advanced text editor, R's help system, version control, and much more into a single application. RStudio does not perform any statistical operations; it only makes it easier for you to perform such operations with R. Most importantly, RStudio offers many facilities that make working reproducibly a lot easier.

The following table gives an overview of some of the most important features of RStudio that you will learn to use with this book:

Features

Description

Integration of the R console

Type commands directly in the R console within RStudio.

Code execution

Directly execute code from your script file.

Syntax highlighting

Color (possibly self-defined) keywords and functions for easy reading.

Bracket support

Matching brackets are highlighted upon selection. When typing a bracket "[", brace "(", curly brace or single or double quote, Rstudio autocompletes it for you.

Command completion

Press Tab halfway while typing a command and RStudio shows a menu of matching R functions. When a function is chosen, its arguments and "help" can be shown as well.

Keyboard shortcuts

Common tasks can be accessed quickly by pressing a key or key combination.

Help integration

RStudio allows for browsing and searching R's native help files, and offers context-related help as well.

Object browser

You can inspect every object defined in the running R session.

History browser

RStudio makes it easy to see what commands you used and re-execute them.

Code navigation

Jump from the use of a function to its definition. Jump from code in a report to the code in the source.

Data viewer

A spreadsheet-like view of tables (data.frames).

Data import menus

For some of the most common data types RStudio has a menu that generates the R read command for you.

Graphics integration

Zoom, manipulate, and export graphics interactively.

Project management

Easily switch between several projects.

Version control

RStudio integrates the popular version control systems git and svn.

Document generation

Generate pdf, html, or other report formats using RMarkdown, Sweave, or knitr with the push of a button.

Publishing

Publish your reports and scripts online at Rpubs.com so that others may learn from your examples.

Readers with some programming experience might wonder why a feature such as debugging support is not in the list. The answer is that it is just not there yet. RStudio is continuously being improved and updated, and according to the forums at RStudio's web pages, support for debugging is certainly on the to-do list of the makers.