title: How to get all the values of the matrix in a single row?
body: <p>I have 40 images of size 480*640 (jpeg IMAGES),For each images I need to put the whole matrix in a single row...so for 40 images I need 40 rows of observations.</p>
  
  <pre><code>filenames &lt;- list.files("C:/Users/Desktop/PatternRecognition/texture/T1", 
  pattern = "*.jpg", full.names = TRUE)
  result={}
  for (i in 1:length(filenames)){
   x &lt;- readJPEG(filenames[i])
   y &lt;- getChannels(x)
   y &lt;- as.vector(y)
   result &lt;- rbind(result,y)
  }
  
  x=matrix(x)
  x
  </code></pre>
  
  <p>In The above code <code>getChannels</code>  is not working.</p>