Tabulating outliers in R
<p>i found this script for identifying and removing outliers in your data. The code lets you choose if you want to remove the detected outliers or not. Here be the link to the code and the article for it:</p>

<p><a href="https://www.r-bloggers.com/identify-describe-plot-and-remove-the-outliers-from-the-dataset/" rel="nofollow">https://www.r-bloggers.com/identify-describe-plot-and-remove-the-outliers-from-the-dataset/</a></p>

<p>What i want to do is not to remove the outliers but to copy them and create a different data set with them. For example if i have have a data set of 100 000 records and i have 3500 outliers detected by this script, i want to take those 3500 records and create an entire data set containing only them so i can do additional analysis on them later on. I do not want to remove them from the original data set.</p>

<p>Is there a way to do that? Thank you!</p>

<p>EXAMPLE:</p>

<pre><code>var1   var2   
a      15     
b      1
c      2
d      1
e      3
</code></pre>

<p>The algorithm then recognizes that row 1</p>

<pre><code>var1    var2
a       15
</code></pre>

<p>Is an outlier and displays something of the sort:</p>

<p>Outliers detected: 1
Percentage: 20%</p>

<p>And so on and so forth. The script however does not give me a separate data set that contains only the outliers. How do i do that? Please?</p>