Handling missing values in R
To handle the missing value we will check the columns of the datasets, if we found some missing data inside the columns then this generates the NA values as an output, which can be not good for every model. So let’s check it using mean() methods.
R
mean (airquality$Solar.R) |
Output:
<NA>
Checking another column
R
mean (airquality$Ozone) |
Output:
<NA>
Checking another column
Here we get the mean value of Wind Columns which means it doesn’t have any missing value in this column.
R
mean (airquality$Wind) |
Output:
9.95751633986928
Handling NA values
Handling NA value using na.rm in both columns.
R
mean (airquality$Solar.R, na.rm = TRUE ) |
Output:
185.931506849315
Also performing the same operation on another column.
R
mean (airquality$Ozone, na.rm = TRUE ) |
Output:
42.1293103448276
Data Cleaning in R
In this article, we will briefly be going through Data cleaning with its application and its technique for implementation in the R programming language.
Contact Us