The first method — is.na()
is.na tests the presence of missing values or null values in a data set. The method searches through every single column of the dataset, finding outliers with a na value that might affect the calculation.
Example;
x <- c(1,2,3,4,NA) is.na(x) returns a series of FALSE and TRUE depending on whether the values of the vector have na values. The output in this case would be FALSE FALSE FALSE FALSE TRUE
na.omit() method removes the rows with na values from a list. The na.omit() function returns a list without any rows that contain na values. This is the faster way to remove na values in R.
Dealing with missing data from a dataset is critical to proper data science. R makes dealing with this missing data so easy that's why it is often used in statistical analysis.
SOCIAL SHARE CARD GENERATOR