title: Can we get factor matrices in R?
body: <p>It seems not possible to get matrices of factor in R. Is it true? If yes, why? If not, how should I do?</p>
  
  <pre><code>f &lt;- factor(sample(letters[1:5], 20, rep=TRUE), letters[1:5])
  m &lt;- matrix(f,4,5)
  is.factor(m) # fail.
  
  m &lt;- factor(m,letters[1:5])
  is.factor(m) # oh, yes? 
  is.matrix(m) # nope. fail. 
  
  dim(f) &lt;- c(4,5) # aha?
  is.factor(f) # yes.. 
  is.matrix(f) # yes!
  
  # but then I get a strange behavior
  cbind(f,f) # is not a factor anymore
  head(f,2) # doesn't give the first 2 rows but the first 2 elements of f
  # should I worry about it?
  </code></pre>