title: Selection Sort Algorithm in R
body: <p>I would need some help to understand this type of code and the action that happens here. For instance, we take a vector x defined by the integer (8,6,5,4,2,1,9).</p>
  
  <p>The first step of this function would be to check if the condition is given, that the length of this vector is higher than 1. For x, the condition is given.
  The next step is to highlight the position of the smallest value in this vector, this is 6. But I dont understand what actually happens in the next steps and why it has to combine it as a vector?</p>
  
  <pre><code>selsort &lt;- function(x) {
    if(length(x) &gt; 1) {
      mini &lt;- which.min(x)
      c(x[mini], selsort(x[-mini])) #selsort() somewhere in here -&gt; recursion
    } else x   
  }
  </code></pre>