I'm attempting to create a vector of column names which contain one or more NA values using a for loop, but am not having success.
hasnas <- c()
for (i in 1:length(data)){
  if(sum(is.na(data[,i]))>0){
    hasnas <- append(hasnas,names(data[,i]))
 
  }
         
  
}
  
>hasnas
>NULL
Any help would be sincerely appreciated.
 
     
     
     
    