R comes with some special values. Some of the special values in R are NA, Inf, -Inf, and NaN.
The missing values are represented in R by NA. When we download data, it may have missing data and this is represented in R by NA:
z = c( 1,2,3, NA,5,NA) # NA in R is missing Data
To detect missing values, we can use the
install.packages() function or
is.na(), as shown:
complete.cases(z) # function to detect NA
is.na(z) # function to detect NA
To remove the NA values from our data, we can type the following in our active R session console window:
clean <- complete.cases(z) z[clean] # used to remove NA from data
Please note the ...