title: Delete columns that had more than 30% of repeated values or more than 1% of values outside the range defined by the mean +- 2.5 SD in r
body: <p>Maybe it is a basic question on data edition but I didn´t found a similar Q&amp;A in stack overflow.</p>
  <p>I have a data frame of ~18 rows x 200 columns.
  Here it is a reduced toy example:</p>
  <p><code>DF &lt;- data.frame(x1=c(0.1,1,0.7,765,0.4,0.3,0.5,3.6,5,11), x2=c(2,2,6,7,6,6,4,2,2,2), x3=c(4,2,3,4,5,4.2,4.6,2.2,2.7,2.8))</code></p>
  <p>I want to delete all columns with more 30% of repeated values, in this case the columns <strong>x2</strong>. In the toy example should be deleted due to have more than 30% of repeated values (many repeated two and six).</p>
  <p>I also want to delete the columns with more than 1% of values outside the range defined by the mean +- 2.5 SD. In the toy example the column <strong>x1</strong> should be removed since the SD <code>sqrt(var(DF$x1))</code>= 241.14 and the mean <code>mean(DF$x1)</code> = 78.76, therefore the mean + 2.5 SD is = 78.76 + (2.5*241.14) = 681.61, and there in the DF$x1 there is a value higher than this, representing the 10% of values in <code>DF$x1</code> (due to only have ten rows in the table)</p>