title: tidyr: Gathering two values per key
body: <p>I have a dataset with the mean and sd of each variable as columns, but I want to convert it into "long" format as so:</p>
  
  <pre><code>library(tidyverse)
  
  iris %&gt;% 
    group_by(Species) %&gt;% 
    summarize_all(list(mean = mean, sd = sd))
  #&gt; # A tibble: 3 x 9
  #&gt;   Species Sepal.Length_me~ Sepal.Width_mean Petal.Length_me~
  #&gt;   &lt;fct&gt;              &lt;dbl&gt;            &lt;dbl&gt;            &lt;dbl&gt;
  #&gt; 1 setosa              5.01             3.43             1.46
  #&gt; 2 versic~             5.94             2.77             4.26
  #&gt; 3 virgin~             6.59             2.97             5.55
  #&gt; # ... with 5 more variables: Petal.Width_mean &lt;dbl&gt;,
  #&gt; #   Sepal.Length_sd &lt;dbl&gt;, Sepal.Width_sd &lt;dbl&gt;, Petal.Length_sd &lt;dbl&gt;,
  #&gt; #   Petal.Width_sd &lt;dbl&gt;
  
  
  # Desired output:
  #
  # tribble(~Species, ~Variable, ~Mean, ~SD
  #         #-------------------------------
  #         ...     )
  </code></pre>
  
  <p>I feel like <code>tidyr::gather</code> would be good to use here, however, I am not sure how the syntax would work for having two values per key. Or perhaps I need to use two gathers and column bind them?</p>