title: Converting a matrix into a gray scale image in R
body: <p>I have the following vector:</p>
  
  <pre><code> vec&lt;-as.vector(rnorm(1:924))
  </code></pre>
  
  <p>And would like to reshape it into a matrix of the form 33 X 28. Then convert the matrix into a gray scale pixel like image.</p>
  
  <p>In MATLAB, I know there exists <em>imagesc</em> and <em>imshow</em> to convert the matrix into an image. Is there something similar in R ?</p>
  
  <p>Also, can the mean and maximum be adjusted like in MATLAB for the gray scale intensity?</p>