R Multiply specific rows and columns by constant
<p>I have the following data:</p>

<pre><code>type &lt;- c(1:4)
year1 &lt;- c(1:4)
year2 &lt;- c(1:4)
year3 &lt;- c(1:4)
data &lt;- data.frame(type, year1, year2, year3)
</code></pre>

<p>I want to multiply the bottom two rows within Year columns by two. </p>

<pre><code>type &lt;- c(1:4)
year1 &lt;- c(1, 2, 6, 8)
year2 &lt;- c(1, 2, 6, 8)
year3 &lt;- c(1, 2, 6, 8)
final &lt;- data.frame(type, year1, year2, year3)
</code></pre>

<p>How do I do this without affecting the other rows of columns?</p>