title: pivot_longer: passing "names_sep" as character yields different result than passing it as character index
body: <p>Say we have a data frame which looks something like</p>
  <pre><code>df &lt;- data.frame(x_A = c(1, 2), x_B = c(3, 4), y_A = c(5, 6), y_B = c(7, 8))
  df
    x_A x_B y_A y_B
  1   1   3   5   7
  2   2   4   6   8
  </code></pre>
  <p>Using <code>library(dplyr)</code> I'm wondering why passing <code>names_sep = &quot;_&quot;</code> in <code>pivot_longer</code> yields a different result than <code>names_sep = 2</code>, as seen in the following</p>
  <pre><code>pivot_longer(df, x_A:y_B, names_to = c(&quot;name1&quot;, &quot;name2&quot;), names_sep = &quot;_&quot;)
  # A tibble: 8 x 3
    name1 name2 value
    &lt;chr&gt; &lt;chr&gt; &lt;dbl&gt;
  1 x     A         1
  2 x     B         3
  3 y     A         5
  4 y     B         7
  5 x     A         2
  6 x     B         4
  7 y     A         6
  8 y     B         8
  </code></pre>
  <pre><code>pivot_longer(df, x_A:y_B, names_to = c(&quot;name1&quot;, &quot;name2&quot;), names_sep = 2)
  # A tibble: 8 x 3
    name1 name2 value
    &lt;chr&gt; &lt;chr&gt; &lt;dbl&gt;
  1 x_    A         1
  2 x_    B         3
  3 y_    A         5
  4 y_    B         7
  5 x_    A         2
  6 x_    B         4
  7 y_    A         6
  8 y_    B         8
  </code></pre>
  <p>When passing a string with the character to break on, that character itself is dropped. When passing the index of the character, it is not. Could someone explain why there is a difference?</p>