title: Finding the max of a R dataframe column ignoring -Inf and NA
body: <p>I have a R dataFrame from which some columns have -Inf and Na. I would like to find the max of a specific column ignoring the Inf and NA. My dataFrame df is as follow:</p>
  
  <pre><code>column1     column2
    -Inf        2
     4          8
     Na         5
     7          4
     10         4 
  </code></pre>
  
  <p>I tried using </p>
  
  <pre><code>temp=df
  temp[is.infinite(temp)]&lt;-NA
  my_max=max(temp$column1, na.rm=TRUE)
  </code></pre>
  
  <p>but I get the following error:</p>
  
  <pre><code>Error in is.infinite(temp) : default method not implemented for type 'list'
  </code></pre>
  
  <p>I would like to my_max to be equal to 10. How can I tackle this problem?</p>