title: Sankey plot with the riverplot package
body: <p>Enchanté.</p>
  
  <p>EDIT: Solution</p>
  
  <p>As pointed out by MartineJ and emilliman5, nodes should be uniquely labelled (below).</p>
  
  <pre><code>library("riverplot")
  nodes&lt;-structure(list(ID = c("2011+", "2011-", "2016+", "2016-"), x = c(20, 
  20, 30, 30), y = c(50, 40, 50, 40)), class = "data.frame", row.names = c(NA, 
  -4L))
  edges&lt;-structure(list(N1 = c("2011+", "2011-", "2011+", "2011-"), N2 = 
  c("2016+", "2016-", "2016-", "2016+"), Value = c(461, 7, 0, 46)), class = 
  "data.frame", row.names = c(NA, -4L))
  
  river &lt;- makeRiver(nodes,edges)
  riverplot(river)
  </code></pre>
  
  <p>I've been toying to plot a Sankey diagram/riverplot (using the <a href="http://cran.r-project.org/web/packages/riverplot/riverplot.pdf" rel="nofollow noreferrer">riverplot</a> package) of how cancer registrations evolve over time, though this code has bought me little success so far. Could anyone possibly direct me on the faults of this code?</p>
  
  <pre><code>Warning message: In checkedges(x2$edges, names(x2)) : duplicated edge information, removing 1 edges
  </code></pre>
  
  <p>Here is the suspect code:</p>
  
  <pre><code>library(“riverplot”)
  
  edges&lt;-structure(list(N1 = c("+", "-", "+", "-"), N2 = c("+", "-", "-", "+"), Value = c(664L, 50L, 0L, 46L)), .Names = c("N1", "N2", "Value"), class = "data.frame", row.names = c(NA, -4L))
  
  nodes = data.frame(ID = unique(c(edges$N1, edges$N2)), stringsAsFactors = FALSE)
  
  nodes$x = c(1,2)
  rownames(nodes) = nodes$ID
  
  rp &lt;- list(nodes=nodes, edges=edges)
  
  class(rp) &lt;- c(class(rp), "riverplot")
  
  plot(rp)
  </code></pre>
  
  <p>And the data, which is included in code:</p>
  
  <pre><code>N1    N2    Value
   +     +     664
   -     -      50
   +     -       0
   -     +      46
  </code></pre>
  
  <p>Eternally grateful.</p>