title: Tidyr::spread() error: Each row of output must be identified by a unique combination of keys
body: <p>I am learning tidyr and doing a small exercise to transform <code>iris</code> data set from wide to long. </p>
  
  <p>The original data set:</p>
  
  <pre><code>   Species Sepal.Length Sepal.Width Petal.Length Petal.Width
  1  setosa          5.1         3.5          1.4         0.2
  2  setosa          4.9         3.0          1.4         0.2
  3  setosa          4.7         3.2          1.3         0.2
  4  setosa          4.6         3.1          1.5         0.2
  5  setosa          5.0         3.6          1.4         0.2
  6  setosa          5.4         3.9          1.7         0.4
  </code></pre>
  
  <p>The resulting data set I want:</p>
  
  <pre><code>  Species  Part Length Width
  1  setosa Petal    1.4   0.2
  2  setosa Petal    1.4   0.2
  3  setosa Petal    1.3   0.2
  4  setosa Petal    1.5   0.2
  5  setosa Petal    1.4   0.2
  6  setosa Petal    1.7   0.4
  
  </code></pre>
  
  <p>The code I wrote for manipulating data set:</p>
  
  <pre><code>iris_re &lt;- iris[,c(5,1,2,3,4)]
  
  iris.wide &lt;- iris_re %&gt;% 
    gather(key = "flower_att", value = "measurement",
           -Species) %&gt;%
    separate(flower_att, into = c("Part","Method")) %&gt;%
    spread(Method,measurement)
  </code></pre>
  
  <p>But the final line of <code>spread()</code> gives me an error: </p>
  
  <blockquote>
    <p>Error: Each row of output must be identified by a unique combination of keys. Keys are shared for 400 rows:</p>
  </blockquote>
  
  <p>I did not expect this happen and I am still struggling with it. Thank you!</p>