title: dplyr `pivot_longer()` object not found but it's right there?
body: <pre><code>library(tidyverse)
  df &lt;- tibble(Date = as.Date(c("2020-01-01", "2020-01-02")),
               Shop = c("Store A", "Store B"),
               Employees = c(5, 10),
               Sales = c(1000, 3000))
  
  #&gt; # A tibble: 2 x 4
  #&gt;   Date       Shop    Employees Sales
  #&gt;   &lt;date&gt;     &lt;chr&gt;       &lt;dbl&gt; &lt;dbl&gt;
  #&gt; 1 2020-01-01 Store A         5  1000
  #&gt; 2 2020-01-02 Store B        10  3000
  </code></pre>
  
  <p>I'm switching from dplyr spread/gather to pivot_* following the <a href="https://tidyr.tidyverse.org/reference/pivot_longer.html" rel="nofollow noreferrer">dplyr reference guide</a>. I want to gather the "Employees" and "Sales" columns in the following manner:</p>
  
  <pre><code>df %&gt;% pivot_longer(-Date, -Shop, names_to = "Names", values_to = "Values")
  #&gt; Error in build_longer_spec(data, !!cols, names_to = names_to, 
  #&gt; values_to = values_to, : object 'Shop' not found
  </code></pre>
  
  <p>But I'm getting this error. It seems as though I'm doing everything right. Except that I'm apparently not. Do you know what went wrong?</p>