1.8 Data Filters: is.na() for Missing Data
In previous post we have learned how to filter data for non missing data. In this one, we will learn how to filter out missing data using is.na(). Let's look at first 24 rows using head() to see the missing values.Just like previous post, if we use the same logic we get NA.
The other way to tackle this is is.na(). This function checks if the value contained is NA or not.
We try this function, by creating a vector named "a" putting some NAs in it and checking it with is.na(). It gives the value FALSE if its not NA and TRUE if it contains NA. We will use the similar function for our dataset to find out NA in Revenue column.
It correctly identifies the values in Revenue column which are equal to NAs.
Try to implement it in other columns as well and find out the rows which contains missing values.
Comments
Post a Comment