Finding number of missing values and removing those missing values from a data-frame

+1 vote

I have this data-frame "Box_Category" with missing values:

ID        Category       Count
1            A             10
2            F             10
3            NA            13
4            B             NA
5            C             NA
6            NA            12
7            D             9
8            NA            NA
9            C             10

There are 5312 rows in total and I would want to find out the total number of NA values in the enitre data-set and remove all those NA values.

Mar 27, 2018 in Data Analytics by kurt_cobain
• 9,240 points

edited Mar 27, 2018 by kurt_cobain 26 views

1 answer to this question.

0 votes

This code gives the total number of missing values:

sum(is.na(Box_Category))

Now, you can go ahead remove all the NA values with this command:

na.omit(Box_Category)
answered Mar 27, 2018 by Bharani
• 4,550 points

Related Questions In Data Analytics

0 votes
1 answer

How to remove rows with missing values (NAs) in a data frame?

You can use complete.cases in the following ...READ MORE

answered Apr 13, 2018 in Data Analytics by darklord
• 6,140 points
3,685 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to convert a list of vectors with various length into a Data.Frame?

We can easily use this command as.data.frame(lapply(d1, "length< ...READ MORE

answered Apr 4, 2018 in Data Analytics by DeepCoder786
• 1,700 points
47 views
0 votes
2 answers

Transforming a key/value string into distinct rows in R

We would start off by loading the ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,550 points
46 views
0 votes
1 answer

Finding frequency of observations in R

You can use the "dplyr" package to ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,550 points
77 views
0 votes
1 answer

Left Join and Right Join using "dplyr"

The below is the code to perform ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,550 points
81 views
0 votes
1 answer

Plotting multiple graphs on the same page in R

If you want to plot 4 graphs ...READ MORE

answered Mar 27, 2018 in Data Analytics by Bharani
• 4,550 points
41 views
0 votes
1 answer

Building Random Forest on a data-set comprising of missing(NA) values

You have two options, either impute the ...READ MORE

answered Apr 2, 2018 in Data Analytics by Bharani
• 4,550 points
96 views
+1 vote
1 answer

Custom Function to replace missing values in a vector with the mean of values

You have missed out on "na.rm=TRUE" inside ...READ MORE

answered Mar 27, 2018 in Data Analytics by Bharani
• 4,550 points
47 views