Chapter 2. Preparing for Analysis – Data Cleansing and Manipulation

In this chapter, we will cover the following topics:

  • Getting a sense of your data structure with R
  • Preparing your data for analysis with the tidyr package
  • Detecting missing values
  • Substituting missing values by interpolation
  • Detecting and removing outliers
  • Performing data filtering activities

Introduction

Some studies estimate that data preparation activities account for 80 percent of the time invested in data science projects.

I know you will not be surprised reading this number. Data preparation is the phase in data science projects where you take your data from the chaotic world around you and fit it into some precise structures and standards.

This is absolutely not a simple task and ...

Get RStudio for R Statistical Computing Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.