for loop error while dropiing column in dataframe : i am facing some error in r please do find the below code  
for (i in 1:64) { if (sum(is.na(prop_train$nam[i]))/length(prop_train$nam[i]) > .3) {prop_train$nam[i] <- NULL}  }     

 about code : i am writing this code for droping the columns which are have NA more tha 30%  in dataframe ,
 
but i am facing this 

error:Error in if (sum(is.na(prop_train$nam[i]))/length(prop_train$nam[i]) >  :    missing value where TRUE/FALSE needed In addition: Warning message: In is.na(prop_train$nam[i]) :