title: Specify colors for each link in a force directed network, networkD3::forceNetwork()
body: <p>The question is to specify two different colors based on the Value or weight of the link using <code>networkD3::forceNetwork</code> in R. For example, <code>Blue</code> for the weight of links more than 1, <code>dark</code> for the weight of links less than 1. </p>
  
  <p>Example code, copied from <a href="https://christophergandrud.github.io/networkD3/" rel="nofollow noreferrer">here</a> (the <code>forceNetwork</code> section):</p>
  
  <pre><code>library(networkD3)
  # Load data
  data(MisLinks)
  data(MisNodes)
  
  # Plot
  forceNetwork(Links = MisLinks, Nodes = MisNodes,
          Source = "source", Target = "target",
          Value = "value", NodeID = "name",
          Group = "group", opacity = 0.8)
  </code></pre>
  
  <p>A d3-js related question is <a href="https://groups.google.com/forum/#!topic/d3-js/fs4u0392Eno" rel="nofollow noreferrer">here</a> (I know nothing about JS so far).</p>