title: How to set unique row and column names of a matrix when its dimension is unknown?
body: <p>I have matrix like :</p>
  
  <pre><code>     [,1][,2][,3][,4]
  [1,]  12  32  43  55
  [2,]  54  54  7   8
  [3,]  2   56  76  88
  [4,]  58  99  93  34
  </code></pre>
  
  <p>I do not know in advance how many rows and columns I will have in matrix. Thus, I need to create row and column names dynamically.</p>
  
  <p>I can name columns (row) directly like:</p>
  
  <pre><code>colnames(rmatrix) &lt;- c("a", "b", "c", "d")
  </code></pre>
  
  <p>However, how can I create my names vector dynamically to fit the dimensions of the matrix?</p>
  
  <pre><code>nm &lt;- ("a", "b", "c", "d")
  colnames(rmatrix) &lt;- nm 
  </code></pre>