November 2016
Beginner to intermediate
959 pages
43h 46m
English
Datasets come with varying amounts of missing data. When we have abundant data, we sometimes (not always) want to eliminate the cases that have missing values for one or more variables. This recipe applies when we want to eliminate cases that have any missing values, as well as when we want to selectively eliminate cases that have missing values for a specific variable alone.
Download the missing-data.csv file from the code files for this chapter to your R working directory. Read the data from the missing-data.csv file while taking care to identify the string used in the input file for missing values. In our file, missing values are shown with empty strings:
> dat <- read.csv("missing-data.csv", na.strings="") ...Read now
Unlock full access