title: Recoding Numeric Vector R
body: <p>I have a numeric vector, let's say something like:</p>
  
  <pre><code>x &lt;- rep(1:6, 300)
  </code></pre>
  
  <p>What I would like to do is recode the vector, in place such that 6=1,5=2,4=3,3=4,2=5,1=6. I don't want to create a factor out of it. </p>
  
  <p>Everything I have tried so far gives me the wrong counts because of the order, ie: </p>
  
  <pre><code>x[x == 6] &lt;- 1 
  x[x == 5] &lt;- 2 ## Lines that follow where x[x == 2] removes 5's entirely from counts. 
  </code></pre>
  
  <p>Note: I'm aware of the car package, but would prefer to use base R for this problem.</p>