title: if else loop not working
body: <p>I am a beginner in R studio, so hopefully someone can help me with this problem. <em>The case:</em> I want to make an if else loop. I made the following code  for an <code>l</code> times <code>m</code> matrix:</p>
  
  <pre><code>for (i in 1:l){
    for (j in 1:m){ 
      if (is.na(quantilereturns[i,j]) &lt; quantile(quantilereturns[,j], c(.1), na.rm=TRUE)) { 
        quantilereturns[i,j]    
      } else { (0) }
    }
  }
  </code></pre>
  
  <p><em>Summary:</em> I want to make a matrix with values that are smaller than the quantile of a certain vector in the matrix <code>quantilereturns</code>. So when they are smaller than the 10% quantile they get their original value otherwise it will be a zero. 
  The code doesn't give any errors, but it doesn't change the values in the matrix either. 
  Can someone help me? </p>