title: Replace negative values by zero
body: <p>We want to set all values in an array zero that are negative.</p>
  
  <p>I tried out a a lot of stuff but did not yet achieve a working solution.
  I thought about a for loop with condition, however this seems not to work.</p>
  
  <pre><code>#pred_precipitation is our array
  pred_precipitation &lt;-rnorm(25,2,4)     
  
  for (i in nrow(pred_precipitation))
  {
    if (pred_precipitation[i]&lt;0) {pred_precipitation[i] = 0}
    else{pred_precipitation[i] = pred_precipitation[i]}
  }
  </code></pre>