title: Apply function (quantile) to matrix rows and use result to modify row
body: <p>I have a matrix, A, filled with random values with shape 10x10. How can I perform a function on each row (finding the 75th quantile), and divide each element in that row of A by that result?</p>
  
  <p>In the below attempt, I am getting a single value for q, but q should be at least 10 values (one for every row). At that point I should be able to do element-wise division with <code>A/q</code>.  What am I doing wrong?</p>
  
  <pre><code>A &lt;- matrix(rnorm(10 * 10), 10, 10)
  q &lt;- c(quantile(A[1,], 0.75))
  A/q
  </code></pre>