text: user9448: I have a very big matrix I want to put colnames as cell1, cell2, et,.. but I get error
  > colnames(new.dat)
  NULL
  > View(new.dat)
  > dim(new.dat)
  [1]     34 263086
  > colnames(new.dat)=make.names(c(1: 263086, "cell"))
  Error in dimnames(x) <- dn : 
    length of 'dimnames' [2] not equal to array extent
  > colnames(new.dat) <- paste0("cell", seq_along(new.dat))
  Error in dimnames(x) <- dn : 
    length of 'dimnames' [2] not equal to array extent
  > 
  
  
  any help?
  
  user-1: You should really test your code:
  make.names(c(1: 5, "cell"))
  [1] "X1"   "X2"   "X3"   "X4"   "X5"   "cell"
  
  This is obviously wrong.
  Better:
  colnames(new.dat) <- paste0("cell", 1:ncol(new.dat))
  
  
original_text: 9448: <p>I have a very big matrix I want to put colnames as cell1, cell2, et,.. but I get error</p>
  <pre><code>&gt; colnames(new.dat)
  NULL
  &gt; View(new.dat)
  &gt; dim(new.dat)
  [1]     34 263086
  &gt; colnames(new.dat)=make.names(c(1: 263086, &quot;cell&quot;))
  Error in dimnames(x) &lt;- dn : 
    length of 'dimnames' [2] not equal to array extent
  &gt; colnames(new.dat) &lt;- paste0(&quot;cell&quot;, seq_along(new.dat))
  Error in dimnames(x) &lt;- dn : 
    length of 'dimnames' [2] not equal to array extent
  &gt; 
  </code></pre>
  <p><a href="https://i.stack.imgur.com/0RXFO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0RXFO.jpg" alt="enter image description here" /></a></p>
  <p>any help?</p>
   -1: <p>You should really test your code:</p>
  <pre><code>make.names(c(1: 5, &quot;cell&quot;))
  [1] &quot;X1&quot;   &quot;X2&quot;   &quot;X3&quot;   &quot;X4&quot;   &quot;X5&quot;   &quot;cell&quot;
  </code></pre>
  <p>This is obviously wrong.</p>
  <p>Better:</p>
  <pre><code>colnames(new.dat) &lt;- paste0(&quot;cell&quot;, 1:ncol(new.dat))
  </code></pre>
  