text: Q:
  
  why i cant change contents in column in R？
  
   > data$Accepted.Final.round
   [1] NA NA NA NA NA NA NA NA  1 NA NA NA NA  1  1  1  1  0  1  0  0  1  1  1  
    1  
    1 NA  1  1  1  1
   [32] NA  1  1  0  1  1  1  1  1  1 NA  1  1  0  1  1  0  1  1  1  1  1  1  1  
    1 
    NA  1 NA NA NA NA
   [63] NA NA NA NA NA NA NA NA NA NA NA NA  1 NA NA NA NA NA NA NA NA NA NA NA 
    NA 
    NA NA NA NA NA NA
   [94] NA NA NA NA NA NA NA NA NA NA NA NA NA  1 NA NA NA NA NA
  
  I have a dataset column consists of NA, 1, 0. However when I try 
   data$Accepted.Final.round[data$Accepted.Final.round==NA]<-0
  
  or
   ifelse(data$Accepted.Final.round==1,1,0)
  
  to replace NA with 0, both lines cannot work.
  Could you guys think of any ways to fix this?
  
  A:
  
  Use is.na() to determine if a value is NA. NA is contagious, meaning that doing operations with NA usually returns NA. That includes checking for equality with ==, i.e. x == NA will always return NA and not TRUE or FALSE.
  x <- c(2, NA, 2)
  x[is.na(x)] <- 0
  
  