title: Edge coloring of graph in R
body: <p>My program generates a graph based on a .txt file. For example, if it is written 1,5 and 2,3 in the file, the program creates graph connecting 1st and 5th, and 2nd and 3rd nodes. Here is the code:</p>
  
  <pre><code>library(igraph)
  dat&lt;-read.table("file.txt", header = F, sep = ",")
  dat[,c(1,2)]
  vertices&lt;-as.vector(t(dat[,1:2]))
  g&lt;-graph(vertices,directed = F)
  plot(g,layout=layout.circle)
  </code></pre>
  
  <p>My question is: How can I do edge coloring based on some condition? For example, if the program reads <strong>3,5</strong> in file for the first time, I want the edge to be red, then if it reads again <strong>3,5</strong> I want the second edge to be blue, and if there is a third pair of <strong>3,5</strong> I want it to be yellow. Is this possible? Thanks.</p>