title: How to replace NaN value with zero in a huge data frame?
body: <p>I tried to replace <code>NaN</code> values with zeros using the following script: </p>
  
  <pre><code>rapply( data123, f=function(x) ifelse(is.nan(x),0,x), how="replace" )
  # [31]   0.00000000  -0.67994832   0.50287454   0.63979527   1.48410571  -2.90402836
  </code></pre>
  
  <p>The NaN value was showing to be zero but when I typed in the name of the data frame and tried to review it, the value was still remaining NaN.</p>
  
  <pre><code>data123$contri_us
  # [31]          NaN  -0.67994832   0.50287454   0.63979527   1.48410571  -2.90402836
  </code></pre>
  
  <p>I am not sure whether the <code>rapply</code> command was actually applying the adjustment in the data frame, or just replaced the value as per shown.</p>
  
  <p>Any idea how to actually change the <code>NaN</code> value to zero?</p>