vendredi 8 novembre 2019

I want to check if the NA values of the rows in one column are equal to NA values of the other column

DataSet ^This is the dataset that I've been working on which has columns Roof (Yes or No) and Roof Area (Numerical).I'm under the assumption that NA values of Roof column will be equal to Roof Area. I used the following if condition in R

if (is.na(train$roof)==is.na(train$Roof.Area.))
  print("Its True")
[1] "Its True"
Warning message:
In if (is.na(train$roof) == is.na(train$Roof.Area.)) print("Its True") :
  the condition has length > 1 and only the first element will be used



This is the output I got with the Warning message.Did I not get it right ?

Aucun commentaire:

Enregistrer un commentaire