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

Datasets


In this chapter, we will use the temperature dataset of Massachusetts; this public dataset was downloaded from http://cdiac.ornl.gov/. This dataset holds the maximum temperature recorded at Massachusetts on a daily basis from 1980 to 2010. The temperature in this dataset is rounded off to an integer and the missing values are represented as NA. We will use this dataset to learn about the techniques involved in the forecasting algorithm.

Note

Note that changes in terms of representation of the data have been made to make the dataset more R-friendly in terms of reading and computing.

Let's have a look at the dataset by reading the dataset to the R environment:

# reading the dataset
data <- read.csv("Data/msdata.csv")
head(data, 10)

The output of the preceding code is as follows:

The preceding dataset needs some modifications, such as the date format has to be changed to one that will be supported for the time series analysis and the missing values in the dataset have to be replaced...