Learning RStudio for R Statistical Computing is a comprehensive guide to the popular open source integrated development environment for R. In six chapters, we will show you how to perform reproducible statistical research with RStudio. The book covers automatic report generating, advanced R code editing, project files management, data visualization, and more.
Chapter 1, Getting Started: We install R and RStudio on Windows, Mac, and Linux and guide you through your first reproducible research project.
Chapter 2, Writing R Scripts and the R Console: A thorough discussion of RStudio's code editing and execution features, both interactively in the console and in scripts.
Chapter 3, Viewing and Plotting Data: RStudio facilitates inspection of R objects and visualization of data. Learn how to create interactive plots with the manipulate package.
Chapter 4, Managing R Projects: This chapter discusses RStudio's project file management features and version control integration. A short introduction to version control is provided as well.
Chapter 5, Generating Reports: Learn how to automatically transform your data analysis into a beautifully laid out HTML page or a PDF report, making it truly reproducible. RStudio offers several ways to generate reports, all of which are discussed thoroughly in this chapter.
Chapter 6, Using RStudio Effectively: This chapter is reserved for R developers who need to get the most out of RStudio—advanced code editing, code navigation, and package development are discussed in this chapter.
All you need for this book is a reasonably modern computer that allows you to run R and RStudio. This book is not about learning statistics, and although we do not use any advanced statistics in this book, some basic statistical knowledge is assumed. We also expect you to have some experience with R. Although the book is not meant to teach R, some of the less commonly used features of R will be explained in detail where appropriate.
The book is aimed at R developers and analysts who wish to do R statistical development while taking advantage of RStudio functionality to ease their development efforts. Familiarity with R is assumed. Those who want to get started with R development using RStudio will also find the book useful. Even if you already use R but want to create reproducible statistical analysis projects or extend R with self-written packages, this book shows how to quickly achieve this using RStudio.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: "On the bottom right-hand side it shows the first 25 records of the resulting data.frame
."
A block of code is set as follows:
meanLength <- mean(abalone$Length) model <- lm(Whole.weight ~ Length + Sex, data=abalone) x <- 1:3 cv <- function(x, na.rm=FALSE){ sd(x, na.rm=na.rm)/mean(x, na.rm=na.rm) }
Any command-line input or output is written as follows:
form <- as.formula(paste("Length", "Whole.weight", sep="~")) plot(x=form, data=abalone)
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "These packages can be updated by clicking on Check for Updates".
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <[email protected]>
, and mention the book title via the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.
Some of the examples used in this book use GIT version control. You can download all extensive examples from https://github.com/rstudiobook.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]>
with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]>
if you are having a problem with any aspect of the book, and we will do our best to address it.