title: mlogit.data() Error: Assigned data `ids` must be compatible with existing data
body: <p>I have been working hours on that and I simply cannot find any solution to the problem. Hopefully someone here can help.</p>
  
  <p>I'm trying to create a personal choice matrix for some data with the following structure:</p>
  
  <pre><code># A tibble: 2,152 x 32
       age choice canton  lr_s dist_svp dist_fdp dist_bdp dist_cvp dist_glp dist_sp
     &lt;dbl&gt; &lt;fct&gt;  &lt;fct&gt;  &lt;dbl&gt;    &lt;dbl&gt;    &lt;dbl&gt;    &lt;dbl&gt;    &lt;dbl&gt;    &lt;dbl&gt;   &lt;dbl&gt;
   1    39 sp     GE         3       49       25       25        4       16       1
   2    67 sp     ZH         0      100       49       64        4       25       0
   3    42 svp    ZH         7        4        4        1       36        4      36
  
     dist_gps pid_svp pid_fdp pid_bdp pid_cvp pid_glp pid_sp pid_gps french italian
        &lt;dbl&gt;   &lt;dbl&gt;   &lt;dbl&gt;   &lt;dbl&gt;   &lt;dbl&gt;   &lt;dbl&gt;  &lt;dbl&gt;   &lt;dbl&gt;  &lt;dbl&gt;   &lt;dbl&gt;
   1        0       0       0       0       0       0      0       1      1       0
   2        9       0       0       0       0       0      1       0      0       0
   3       36       0       0       0       0       0      1       0      0       0
  </code></pre>
  
  <p>Now, I need to create a personal choice matrix with the 7 alternatives that are indicated by dist_* / pid_* in the columns. </p>
  
  <p>This should, according to my understanding, work with the following code:</p>
  
  <pre><code>work.pc &lt;- mlogit.data(work,
                         varying = c(5:11, 12:18),
                         choice = "choice",
                         shape = "wide",
                         sep = "_")
  </code></pre>
  
  <p>However, when I run this code, I get the following Error message and a few Warning messages:</p>
  
  <pre><code>Error: Assigned data `ids` must be compatible with existing data.
  x Existing data has 15064 rows.
  x Assigned data has 2152 rows.
  ℹ Only vectors of size 1 are recycled.
  Run `rlang::last_error()` to see where the error occurred.
  In addition: Warning messages:
  1: Setting row names on a tibble is deprecated. 
  2: Setting row names on a tibble is deprecated. 
  3: Setting row names on a tibble is deprecated. 
  4: Setting row names on a tibble is deprecated. 
  5: Setting row names on a tibble is deprecated. 
  6: Setting row names on a tibble is deprecated. 
  7: Setting row names on a tibble is deprecated. 
  </code></pre>
  
  <p>What's the issue here? I'm grateful for any help! I've tried everything.</p>