title: Set 0 to NA in R
body: <p>Opposite to <a href="https://stackoverflow.com/questions/10139284/set-na-to-0-in-r">Set NA to 0 in R</a>, I have a data.frame <code>data</code> with columns A and B (and other) in which NAs were replaced by 0 by 
  <code>rowSums(data[,c("A", "B")], na.rm=TRUE)</code>.</p>
  
  <p>I need to re-replace all 0 values by <code>NA</code>. As I am working with a data.frame  containing not only numeric values, <a href="https://stackoverflow.com/questions/14178350/convert-all-zeros-of-a-matrix-in-r-to-na">convert all zeros of a matrix in R to NA</a> doesn't work for me (converting into a matrix doesn't seem promising here).</p>
  
  <p>I tried 
  <code>data["A" == 0] &lt;- NA</code> and <code>data["B" == 0] &lt;- NA</code> - however, it doesn't do anything (the data.frame seems to stay unchanged)</p>