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)

Code execution


There are several ways to execute code in the script editing window. Most of them literally copy the lines with R script to the console window and execute them.

To execute the current line or selection use Ctrl+Enter. The previous command can be rerun using Ctrl+Shift+P.

Tip

Code completion of your code in the editor window will only work if the objects are available in your workspace. Make sure that you execute the assignment of objects in the editor.

Executing a script file line by line is tedious. So RStudio makes it easy to execute (or source) all the lines of a script file with Ctrl+Shift+Enter. This will copy all the lines to the console and execute them. The output of the script is printed in the console windows. Note that RStudio treats the execution of all the lines as one statement.

It is also possible to source the current file without printing statements in the console. This can be done with Ctrl+Shift+S . RStudio makes this even easier with the Source on Save option...