Book Image

Mastering RStudio: Develop, Communicate, and Collaborate with R

4 (1)
Book Image

Mastering RStudio: Develop, Communicate, and Collaborate with R

4 (1)

Overview of this book

RStudio helps you to manage small to large projects by giving you a multi-functional integrated development environment, combined with the power and flexibility of the R programming language, which is becoming the bridge language of data science for developers and analyst worldwide. Mastering the use of RStudio will help you to solve real-world data problems. This book begins by guiding you through the installation of RStudio and explaining the user interface step by step. From there, the next logical step is to use this knowledge to improve your data analysis workflow. We will do this by building up our toolbox to create interactive reports and graphs or even web applications with Shiny. To collaborate with others, we will explore how to use Git and GitHub and how to build your own packages to ensure top quality results. Finally, we put it all together in an interactive dashboard written with R.
Table of Contents (17 chapters)
Mastering RStudio – Develop, Communicate, and Collaborate with R
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Index

The R graphics package—base


The inbuilt R graphics package, better known as the base plotting system, is the first address to start building a plot as it is the default method for plotting data. The graphics package, which provides the base plotting functions and the grDevices package, which includes the code to call the different system devices, are basically building the base plotting system.

The plot creation process can be divided into two phases.

  1. The initialization of a new plot.

  2. The extension of an existing plot.

The function, plot(), calls a graphic device and draws the data as a plot to the device. This plot function includes several basic graph types along with many arguments to annotate the plot. Furthermore, by using a very large number of different parameters, you can easily customize the created graph types.

Creating base plots

For the next plot, we are using the inbuilt, library(datasets), and the JohnsonJohnson dataset, which represents the quarterly earnings per Johnson & Johnson...