R programming: Removing NA values

0 votes
I am new to R programming and I was wondering how to remove null or N/A values.
Jan 31, 2019 in Data Analytics by Sophie may
• 9,900 points
118 views

2 answers to this question.

0 votes

You can make use of the "na.rm" function to remive N/A values.

For example, 

sum(df[,1], na.rm = TRUE) 

where df is your data frame.

answered Jan 31, 2019 by Tyrion anex
• 8,320 points
0 votes
Hi,

Use na.rm = TRUE

or

Fetch values which has no NA values using position.

var[which(!is.na(var))]
answered Aug 30, 2019 by anonymous
• 32,420 points

Related Questions In Data Analytics

0 votes
1 answer

Remove NA values from the output in R programming

Edit your code: columnmean <- function(x, removeNA = ...READ MORE

answered Oct 31, 2018 in Data Analytics by Kalgi
• 50,110 points
54 views
0 votes
4 answers

How to remove NA values from a Vector in R?

You can try na.omit() or na.exclude() too. ...READ MORE

answered Jul 31, 2019 in Data Analytics by anonymous
• 32,420 points
11,457 views
0 votes
2 answers

How can I group a set of values by column using R programming?

Try this , Employee %>% group_by(EmpID) %>% mutate(SumSalary ...READ MORE

answered Aug 14, 2019 in Data Analytics by anonymous
57 views
0 votes
1 answer

Changing variable values using R programming

This should work: df$symbol <- as.character(df$symbol) df$symbol[df$symbol == "ABCD.BO"] ...READ MORE

answered May 27, 2019 in Data Analytics by Zulaikha
• 890 points
40 views
+9 votes
3 answers

Which is a better initiative to learn data science: Python or R?

Well it truly depends on your requirement, If ...READ MORE

answered Aug 8, 2018 in Data Analytics by Anmol
• 3,680 points
97 views
+1 vote
2 answers
0 votes
1 answer

R programming logic

Use gsub to match the substring that we want ...READ MORE

answered Nov 16, 2018 in Data Analytics by Maverick
• 10,800 points
46 views
0 votes
1 answer
0 votes
1 answer

R programming error

Alright, you can either use gsub to match the ...READ MORE

answered Dec 18, 2018 in Data Analytics by Tyrion anex
• 8,320 points
40 views
0 votes
1 answer

Check if a matrix is diagonalizable in R Programming Language

On a given matrix, a, the first way ...READ MORE

answered Dec 24, 2018 in Data Analytics by Tyrion anex
• 8,320 points
66 views