title: Rearranging data columns in R
body: <p>I have an excel file that contains two columns : <code>Car_Model_Year</code> and <code>Cost</code>.</p>
  <pre><code>Car_Model_Year     Cost
  2018              25000
  2010              9000
  2005              13000
  2002              35000
  1995              8000
  </code></pre>
  <p>I want to sort my data as follows:</p>
  <pre><code>Car_Model_Year     Cost
  1995               8000
  2002               35000
  2005               13000
  2010               9000
  2018               25000
  </code></pre>
  <p>So now, the <code>Car_Model_Year</code> are sorted in ascending order. I wrote the following R code, but I don't know how to rearrange the values of the variable <code>Cost</code> accordingly.</p>
  <pre><code>my_data &lt;- read.csv2(&quot;data.csv&quot;)
  my_data &lt;- sort(my_data$Car_Model_Year, decreasing = FALSE)
  </code></pre>
  <p>Any help will be very appreciated!</p>