# Essentials of R for Data Analytics

ISBN: 9789390421923

332 pages

## Description

With widespread and exponential growth of data, people with data science background are in great demand. Data analytics, a subdomain of data science, is meant to turn data into insight and actionable knowledge. Data analytics mainly deals with exploring, visualizing, transforming and modelling data for making predictions. Learning R is an essential step towards becoming a data analyst.

Preface

Acknowledgments

About the Authors

Chapter 1 Introduction to HR Analytics

1.1 Introduction

1.2 About the R Environment

1.3 Starting R and RStudio

1.4 Entering and Executing Commands

1.5 Setting Variables

1.6 Knowing about Objects

1.7 Structure of Objects

1.8 Managing Objects in R’s Workspace

1.9 Creating Sequences

1.10 Operator Precedence

1.11 Setting Working Directory

1.12 Making and Executing Code from Script Files

1.13 Packages in R

Chapter 2 Getting Help in R

2.1 Introduction

2.2 Top-Level Help

2.3 Help On Functions

2.4 Searching Documentation Through Keywords

2.5 Getting Help from Web

2.6 Searching for Relevant Packages

2.7 Getting Help from R Mailing Lists

Chapter 3 Vectors and Factors in R

3.1 Introduction

3.2 Vectors

3.3 Factors

Chapter 4 Matrices in R

4.1 Introduction

4.2 Arrays

4.3 Creating Matrices

4.4 Naming the Dimensions of a Matrix

4.5 Accessing Elements of Matrices

4.6 Arithmetic Operations on Matrices

4.7 Concatenating Matrices

4.8 Replicating Matrices

4.9 Other Useful Operations on Matrices

Chapter 5 Lists and Data Frames in R

5.1 Introduction

5.2 Lists in R

5.3 Data Frames in R

Chapter 6 Strings and Dates in R

6.1 Introduction

6.2 Handling Strings

6.3 Handling Date and Time

Chapter 7 Input Output in R

7.1 Introduction

7.2 Reading Data from Console

7.3 Reading Data from Files

7.4 Displaying Data to Screen

7.5 Saving Objects to Files

7.6 Writing Data to Files

Chapter 8 Conditional Statements and Loops in R

8.1 Introduction

8.2 Control Structures for Conditional Execution

8.3 Looping Structures in R

Chapter 9 Writing Functions in R

9.1 Introduction

9.2 Functions in R

9.3 Defining a Function

9.4 Anonymous Functions

9.5 Scope of objects

9.6 Return Value of a Function

9.7 Named and Default Arguments

9.8 Passing Arguments to a Function

9.9 The … Arguments

9.10 Modifying a Data Frame Using a Function

9.11 Defining New Binary Operators

Chapter 10 An Introduction to Graphics in R

10.1 Introduction

10.2 Pressure Dataset

10.3 Iris Dataset

10.4 My First Plot

10.5 Adding Elements

10.6 Controlling the Type of Scatter Plot

10.7 Controlling the Types of Lines and Points

10.8 Adding Grids

10.9 Customizing Axes

10.10 Scatter Plot with Groups in Data

10.11 Adding Legend

10.12 Adding a Regression Line

10.13 Creating Separate Scatter Plot for Each Factor Level

10.14 Customizing Margins

10.15 Adding Text

10.16 Saving Your Plot

10.17 Working with Multiple Graphics Devices

10.18 Plotting Scatter Plot of all Variables in a Dataset

10.19 Combining Multiple Plots in a Graphics Window

10.20 Graphics Parameters

10.21 A Customized Colourful Plot

Chapter 11 Making Graphs and Charts in R

11.1 Introduction

11.2 Frequency Distribution of Categorical Data: Making Bar Charts

11.3 Frequency Distributions of Continuous Data: Making Histograms

11.4 Five-Number Summary: Making Box Plots

11.5 Visualizing Relationships in Continuous Data: Scatter Plot and Line Charts

11.6 Plotting Functions

11.7 Confirming Data Distribution: Making Q–Q Plots

11.8 Other Plots and Charts

11.9 Contour Plots

Chapter 12 Graphics using ggplot2

12.1 Introduction

12.2 Scatter Plots

12.3 Geometric Objects in ggplot2: Creating Different Plots

12.4 Overall Appearance of a Plot

12.5 Other Resources and References

Chapter 13 Data Transformations in R

13.1 Introduction

13.2 Datasets

13.3 Transformation Functions in “dplyr”

13.4 Data Transformation in Action on iris Dataset

13.5 Answering Questions on flights Dataset

Chapter 14 Predictive Analytics: Classification in R

14.1 Introduction

14.2 Classification

14.3 Some Popular Classification Models

14.4 Implementing Classification in R

Chapter 15 Predictive Analytics: Regression in R

15.1 Introduction

15.2 Simple Linear Regression Model

15.3 Determination of β0 and β1

15.4 Multiple Linear Regression

15.5 Predictive Modelling Using Regression

15.6 Simple Linear Regression Predictive Modelling in R

15.7 Modelling with Multiple Linear Regression in R

15.8 Regression Modelling with Higher Order Ploynomial Terms

15.9 Regression Modelling with Interaction Term

Appendix

Additional Resources

Index