Book Image

R Data Science Essentials

Book Image

R Data Science Essentials

Overview of this book

With organizations increasingly embedding data science across their enterprise and with management becoming more data-driven it is an urgent requirement for analysts and managers to understand the key concept of data science. The data science concepts discussed in this book will help you make key decisions and solve the complex problems you will inevitably face in this new world. R Data Science Essentials will introduce you to various important concepts in the field of data science using R. We start by reading data from multiple sources, then move on to processing the data, extracting hidden patterns, building predictive and forecasting models, building a recommendation engine, and communicating to the user through stunning visualizations and dashboards. By the end of this book, you will have an understanding of some very important techniques in data science, be able to implement them using R, understand and interpret the outcomes, and know how they helps businesses make a decision.
Table of Contents (15 chapters)
R Data Science Essentials
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

According to an article in Harvard Business Review, a data scientist's job is the best job of the 21st century. With the massive explosion in the amount of data generated, and with organizations becoming increasingly data-driven, the requirement for data science professionals is ever increasing.

R Data Science Essentials will provide a detailed step-by-step guide to cover various important concepts in data science. It covers concepts such as loading data from different sources, carrying out fundamental data manipulation techniques, extracting the hidden patterns in data through exploratory data analysis, and building complex, predictive, and forecasting models. Finally, you will learn to visualize and communicate the data analysis to an audience. This book is aimed at beginners and intermediate users of R, taking them through the most important techniques in data science that will help them start their data scientist journey.

What this book covers

Chapter 1, Getting Started with R, introduces basic concepts such as loading the data to R from different sources, implementing various preprocessing techniques to handle missing data and outliers, and managing data from different sources by merging and subsetting it. It also covers arithmetic and string operations in R. Overall, this chapter will help you convert the data to a usable format that can be consumed for further data analysis and model building.

Chapter 2, Exploratory Data Analysis, introduces different statistical techniques that assist not only in the better understanding of the data, but also help in developing intuition about the dataset by summarizing and visualizing the important characteristics of the variables in the dataset.

Chapter 3, Pattern Discovery, focuses on techniques to extract patterns from the raw data as well as to derive sequential patterns hidden in the data. This chapter will touch on the evaluation metrics and the tweaking of parameters to adjust the rank of the association rules. This chapter also discusses the business cases where these techniques can be used.

Chapter 4, Segmentation Using Clustering, demonstrates how and when to perform a clustering analysis, how to identify the ideal number of clusters for a dataset, and how the clustering can be implemented using R. It also focuses on hierarchical clustering and how it is different from normal clustering. You will also learn about the visualization of clusters.

Chapter 5, Developing Regression Models, demonstrates why regression models are used and how logistic regression is different from linear regression. It shows you how to implement regression models using R and also explores the various methods used to check the fit accuracy. It touches on the different methodologies that can be used to improve the accuracy of the model.

Chapter 6, Time Series Forecasting, explains forecasting from fundamentals such as converting the normal data frame to a time series data and shows you methods that help uncover the hidden patterns in time series data. It will also teach you the implementation of different algorithms for the forecasting.

Chapter 7, Recommendation Engine, shows you the basic idea behind a recommendation engine and some of the real-life use cases in the first part of the chapter. In the latter part of the chapter, the popular collaborative filtering algorithm based on items as well as users is explained in detail along with its implementation.

Chapter 8, Communicating Data Analysis, covers some of the best ways to communicate the results to the user, such as how to make data visualization better using packages in R such as ggplot and googleViz, and demonstrates stitching together the visualizations by creating an interactive dashboard using R shiny.

What you need for this book

In order to make your learning efficient, you need to have a computer with Windows, Ubuntu, or OS X.

You need to download R to execute the code mentioned in this book. You can download and install R using the CRAN website available at http://cran.r-project.org/. All the code was written using RStudio. RStudio is an integrated development environment (IDE) for R and can be downloaded from http://www.rstudio.com/products/rstudio/.

Who this book is for

If you are an aspiring data scientist or analyst who has a basic understanding of data science and basic hands-on experience in R or any other analytics tool, then R Data Science Essentials is the book for you.

Conventions

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.

Any command-line input or output is written as follows:

data  <- read.delim("local-data.txt", header=TRUE, sep="\t")
data  <- read.table("local-data.txt", header=TRUE, sep="\t")

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Clicking the Next button moves you to the next screen."

Note

Warnings or important notes appear in a box like this.

Reader feedback

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 , 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.

Customer support

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.

Downloading the example code

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.

Errata

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/submit-errata, 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

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 with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.