title: pivot_longer with multiple classes causes error ("No common type")
body: <p>I am running <code>pivot_longer</code> on multiple columns (i.e. two character columns and one numeric). I am encountering an error related to the class mismatch.</p>
  
  <p>I have investigated the documentation for any "force" options and did not see any arguments within <code>pivot_longer</code> to specify the class to use -- or to allow the function auto-detect the most general class.</p>
  
  <p>Are there any parameters within <code>pivot_longer</code> to avoid this error? Or do you need to convert the columns to a single class before running <code>pivot_longer</code>?</p>
  
  <pre><code>library(dplyr)
  library(tidyr)
  library(ggplot2) # Just for `diamonds` dataset
  
  small_diamonds &lt;- diamonds %&gt;% 
    # Select a few columns (two character, one numeric, specifically integers)
    select(cut, color, price) %&gt;% 
    # Create a row_id
    mutate(row_num = row_number()) 
  
  # This works with `gather`
  small_diamonds %&gt;% 
    gather(key, val, - row_num)
  
  # This fails due to class error:
  small_diamonds %&gt;% 
    # Pivot data
    pivot_longer( - row_num, 
                  names_to = "key",
                  values_to = "val")
  
  # Output
  # Error: No common type for `cut` &lt;ordered&lt;4bd7e&gt;&gt; and `price` &lt;integer&gt;.
  # Call `rlang::last_error()` to see a backtrace
  
  # Convert columns to a single class (character) and then use `pivot_longer`. 
  # Runs successfully
  small_diamonds %&gt;% 
    mutate_all(as.character) %&gt;% 
    # Pivot data
    pivot_longer( - row_num, 
                  names_to = "key",
                  values_to = "val")
  
  </code></pre>