title: Using apply function on a matrix with NA entries
body: <p>I read Data from a csv file. If I see this file in R, I have:</p>
  
  <pre><code>  V1 V2  V3 V4  V5 V6 V7
  1 14 25  83 64 987 45 78
  2 15 65 789 32  14 NA NA
  3 14 67  89 14  NA NA NA
  </code></pre>
  
  <p>If I want the maximum value in each column, I use this:</p>
  
  <pre><code>apply(df,2,max)
  </code></pre>
  
  <p>and this is the result:</p>
  
  <pre><code> V1  V2  V3  V4  V5  V6  V7 
   15  67 789  64  NA  NA  NA 
  </code></pre>
  
  <p>but it works on the column that has no <code>NA</code>. How can I change my code, to compare columns with <code>NA</code> too?</p>