Book Image

Learning R for Geospatial Analysis

By : Michael Dorman
Book Image

Learning R for Geospatial Analysis

By: Michael Dorman

Overview of this book

Table of Contents (18 chapters)
Learning R for Geospatial Analysis
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
External Datasets Used in Examples
Cited References
Index

Dealing with missing values


In this section, we are going to introduce the representation of missing values in R and ways to deal with them. Missing values can arise in many situations during data collection and analysis, either when the required information could not be acquired for some reason or when, due to certain circumstances, we would like to exclude some data from an analysis by marking them as missing. In the spatial data analysis context, it can be that some districts in an area we surveyed were inaccessible for data collection by the researcher or some parts of an aerial image were clouded and we could not digitize features of interest there.

Missing values and their effect on data

The special value that marks missing values in R is NA. As briefly mentioned in the previous chapter, NaN values represent cases when the resulting value cannot be represented within the real system number. NaN values function in the same way as NA in all respects that are relevant here.

The same way...