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)

Additional features for function writing


Functions are an important tool of programming. Functions allow you to separate a set of operations from the main script and give them a useful name. It also allows you to define variables that are otherwise invisible to the rest of the script; in the language of software developers, this is called scoping. Finally, functions can be shared; once you've developed a cool new procedure that takes a data set and creates the most awesome plot, why not write a function for it and share it with your friends?

RStudio has two convenient features for function writing (not discussed earlier in this book)—automatic function extraction and function code retrieval.

Function extraction

RStudio's function extraction feature allows you to select a piece of code and wrap it in a function definition, which can be stored separately for re-use. Here's a simple example. Suppose we've found this procedure that computes one of the roots of a quadratic equation and we've written...