title: How to get outliers for all the columns in a dataframe in r
body: <p>I am working on generic function which will take dataframe and return all the outliers for every variable in a dataframe and then remove it.</p>
  
  <pre><code> outliers &lt;- function(dataframe){
     dataframe &lt;- select_if(dataframe, is.numeric)
     for(i in 1:length(dataframe)){
     paste(names(dataframe)[i]) &lt;- boxplot.stats(names(dataframe)[i])$out)
  
    }
  }
  </code></pre>
  
  <p>I want to output all the outliers in respective variables and then finally remove all the outliers from dataframes.  </p>
  
  <p>I can remove one by one by following</p>
  
  <pre><code>Clean_Data[!Clean_Data$House_Price %in% boxplot.stats(Clean_Data$House_Price)$out,]
  </code></pre>
  
  <p>You can get the data from <code>Clean_Data = read.csv('http://ucanalytics.com/blogs/wp-content/uploads/2016/09/Regression-Clean-Data.csv')</code></p>