title: Find outlier using z score
body: <p>I am trying to create a function in R. The function should find outliers from a matrix using z score. The function should have two arguments as input (x which is a matrix and zs which is an integer). For each raw of the matrix, the function should calculate the zscore for each element and if zscore is bigger than <code>zs</code> or smaller than <code>-zs</code>, then the function should print that element. I know that I can use:</p>
  
  <pre><code>z&lt;- (x-mean(x))/sd(x)   or  z&lt;- scale(x) 
  </code></pre>
  
  <p>for the calculations of z score but as I am a beginner in programming, I find it difficult to solve the problem because of the matrix.</p>