title: Igraph in R: how to change edge color based on edge attribute
body: <p>I am trying to generate an Igraph in R.
  Now I want the edge color dependent on an edge attribute - department.
  I cannot use ifelse statement because department values can be dynamic. I can find the number of unique departments, but I am not sure how to proceed further in creating different edge colors for different departments.</p>
  
  <pre><code>    department= unique(edges$department)
      department.count=length(department)
  </code></pre>
  
  <p>Example Code: </p>
  
  <pre><code>    gg &lt;- graph.atlas(711)
      V(gg)$name=1:7
      gg=set_edge_attr(gg,"Department",E(gg)1:10],c("A","B","C","A","E","C","G","B","C","A"))
      E(gg)$label=E(gg)$Department
      plot(gg)
  </code></pre>
  
  <p>I want to have different colors for each edge, depending on values of department in edge. All 'A' departments in one color , all B department edges in another color , so on. 
  Kindly help.</p>