title: Error : length of 'dimnames' [2] not equal to array extent
body: <p>I have changed a little bit my R code that worked perfectly,but instead 3 now I have 7 clusters.</p>
  
  <pre><code>layout(matrix(c(1, 1, 2, 2, 3, 3, 4, 4, 5), ncol=1))
  
  # main plots
  par(mai=rep(0.5, 4))
  
  fcm &lt;-c(14.0,14.1,13.0,14.2,14.7,13.8,14.0)
  gk  &lt;-c(12.1,12.5,12.2,12.0,11.5,12.0,11.4)
  gg  &lt;-c(14.0,14.1,13.3,12.8,12.0,12.2,12.0)
  data1 &lt;- rbind(fcm,gk,gg)
  colnames(data1) &lt;- c(6,7,8,9,10,11,12)
  
  fcm &lt;-c(2.65,2.55,2.4,2.45,2.45,2.5,2.45)
  gk  &lt;-c(2.45,2.55,2.4,2.3,2.2,2.35,2.1)
  gg  &lt;-c(2.6,2.65,2.5,2.35,2.4,2.4,2.2)
  data2 &lt;- rbind(fcm,gk,gg)
  colnames(data2) &lt;- c(6,7,8,9,10,11,12)
  
  fcm &lt;-c(8.8,6.5,6.6,8.2,8.0,8.4,9.0)
  gk  &lt;-c(12.7,11.0,11.1,10.5,10.7,10.0,9.5)
  gg  &lt;-c(2.1,2.1,1.8,2.0,2.0,1.9,1.8)
  data3 &lt;- rbind(fcm,gk,gg)
  colnames(data3) &lt;- c(6,7,8,9,10,11,12)
  
  fcm &lt;-c(0.47,0.53,0.45,0.39,0.40,0.47,0.48)
  gk  &lt;-c(0.45,0.51,0.34,0.40,0.42,0.42,0.44)
  data4 &lt;- rbind(fcm,gk)
  colnames(data4) &lt;- c(6,7,8,9,10,11,12)
  
  barplot(as.matrix(data1),ylim=c(0,20),main="P wave",
          xlab="number of clusters", ylab="traveltime rms(ms)",
          col=c("red", "black", "green"), beside=TRUE)
  barplot(as.matrix(data2),ylim=c(0,2),main="MT",
          xlab="number of clusters", ylab="MT functions",
          col=c("red", "black", "green"), beside=TRUE)
  barplot(as.matrix(data3),ylim=c(0,20),main="XBI",
          xlab="number of clusters", ylab="index value",
          col=c("red", "black", "green"), beside=TRUE)
  barplot(as.matrix(data4),ylim=c(0,0.6),main="NCE",
          xlab="number of clusters", ylab="index value",
          col=c("red", "black"), beside=TRUE)
  
  par(mai=c(0,0,0,0))
  plot.new()
  legend(legend = c("fcm","gk","gg"), fill = c( "red", "black", "green"), 
      "center", horiz=TRUE)
  </code></pre>
  
  <p>But then I got</p>
  
  <pre><code>Error in `colnames&lt;-`(`*tmp*`, value = c(6, 7, 8, 9, 10, 11, 12)) : 
    length of 'dimnames' [2] not equal to array extent
  </code></pre>
  
  <p>The problem is with the rbind.I am combining 3 vectors,each of them has 7 elements.What should I change?I want that each element has the proper number of clusters labeled behind.</p>