title: Capping each member in an r array
body: <p>I'm new to R and I have losses data:</p>
  
  <pre><code>losses=c(25,250,5,17,2,195,12,8,75,5,50,1);
  </code></pre>
  
  <p>How to cap each member of the list at 150? Namely how to perform <code>min(150,x)</code> for each member of the list?</p>
  
  <p>Then I want to cap all losses at 'amount of insurance' array:</p>
  
  <pre><code>aoi=c(150,250,100,125,300,200,80,250,100,350,500,120) 
  </code></pre>