Error in data.frame(..., check.names = FALSE) : arguments imply differing number of rows: 279, 2
<p>I would like to bind to dataframes with the same number of rows. But the error message says that the number of row is differing. What is wrong in my case?</p>

<pre><code> total&lt;-cbind(CAnw4,rough,by=c("X","Y"))`
</code></pre>

<blockquote>
  <p>Error in data.frame(..., check.names = FALSE) :  arguments imply
  differing number of rows: 279, 2</p>
</blockquote>

<pre><code>nrow(CAnw4)
[1] 279

nrow(rough)
[1] 279


str(CAnw4)
'data.frame':   279 obs. of  3 variables:
        $ X : num  -0.3 -0.3 -0.3 -0.6 -0.6 -0.6 -1 -1 -1 -1 ...
        $ Y : num  0 0 0 0 0 0 -1 -1 -1 -2 ...
        $ KW: num  122 122 122 134 134 ...   `'`

str(rough)

'data.frame':   279 obs. of  22 variables:
            $ X         : num  -0.3 -0.3 -0.3 -0.6 -0.6 -0.6 -1 -1 -1 -1 ...
            $ Y         : num  0 0 0 0 0 0 -1 -1 -1 -2 ...
            $ Ra        : num  10.7 10.7 10.7 10.1 10.2 ...
            $ Rq        : num  14.8 14.7 14.7 14 14.2 ...
            $ Rz_tot    : num  283 282 283 326 329 ...
            $ Rz_x      : num  69.9 69.7 69.5 58.7 59.3 ...
            $ Rz_x_sd   : num  28.1 27.8 27.9 37.8 38.4 ...
            $ Rz_y      : num  64 63.7 63.8 63.2 63.8 ...
            $ Rz_y_sd   : num  34 33.4 33.6 36.1 36.5 ...
            $ mean_freqy: num  16 15.9 16.1 14.9 14.8 ...
            $ sd_freqy  : num  5.22 5.2 5.22 3.78 3.62 ...
            $ mean_freqx: num  14.9 15 15.1 14.2 14.1 ...
            $ sd_freqx  : num  3.41 3.37 3.36 3.99 3.99 ...
            $ max_freqy : int  32 29 30 25 25 23 23 24 23 27 ...
            $ max_freqx : int  26 26 27 28 28 30 24 25 27 28 ...
            $ int       : num  3.66 3.64 3.68 3.6 3.6 ...
            $ sl        : num  1.82 1.82 1.85 1.81 1.8 ...
            $ D         : num  2.09 2.09 2.08 2.1 2.1 ...
            $ l         : num  3.02e+20 1.63e+20 8.23e+23 5.23e+18 6.54e+17 ...
            $ psillx    : num  171 167 167 147 147 ...
            $ rangex    : num  0.186 0.19 0.187 0.168 0.165 ...
            $ nuggetx   : num  4.89 5.14 4.96 3.39 3.3 ...
</code></pre>