Add constant to few values in a vector - R : <p>I have a vector with 5 elements. I need to add a constant value 2nd, 3rd and 4th elements.</p>

<pre><code>ar = c(0, 0, 0, 0, 0)
ar = ar[2:3]+5
</code></pre>

<p>Expected output:</p>

<pre><code>0 5 5 5 0
</code></pre>
