In R, missing values are represented by the symbol┬аNA (not available). Impossible values (e.g., dividing by zero) are represented by the symbol NaN (not a number). Unlike SAS, R uses the same symbol for character and numeric data.
Most modeling functions in R offer options for dealing with missing values. You can go beyond pairwise of listwise deletion of missing values through methods such as multiple imputation. Good implementations that can be accessed through R include Amelia II, Mice, and mitools.
In R, missing values are represented by the symbol┬аNA (not available). Impossible values (e.g., dividing by zero) are represented by the symbol NaN (not a number). Unlike SAS, R uses the same symbol for character and numeric data.
For more practice on working with missing data, try this course on cleaning data in R.
Testing for Missing Values
Recoding Values to Missing
Excluding Missing Values from Analyses
Arithmetic functions on missing values yield missing values.
The function complete.cases() returns a logical vector indicating which cases are complete.
The function na.omit() returns the object with listwise deletion of missing values.
Advanced Handling of Missing Data
Most modeling functions in R offer options for dealing with missing values. You can go beyond pairwise of listwise deletion of missing values through methods such as multiple imputation. Good implementations that can be accessed through R include Amelia II, Mice, and mitools.