title: Calculate function in two different part
body: <p>I have a vector <code>y</code>, which is a series of positive integers. For each value in <code>y</code>, I want to calculate:</p>
  
  <ul>
  <li><code>z &lt;- 1/y</code>, </li>
  <li>but for elements that <code>y</code> is 1 I need to set <code>z</code> is zero.</li>
  <li>Finally I need a vector of <code>z</code> with zero for <code>y</code> is 1 and <code>1/y</code> for <code>y</code> is not 1.</li>
  </ul>
  
  <p>How can I do that?</p>