I am trying to change vertex.shape but it doesn't work :
I have a dataframe like :
Locus X2 X3 Prophage
Vi_1236 Vi_456 5 yes
Vi_1254 Vi_263 6 no
Vi_1369 Vi_139 2 undef
And I want to get a graph with igraph on which I can color the nodes according to their centrality of betweeness and when Prophage == "yes" i want a square node , when its no a circle node and when its undef a triangle node.
So, I did :
phage = graph.data.frame(innerJoinDf)
vertex = ifelse(phage$prophage == "yes","square","circle")
plot.igraph(phage, vertex.label = NA, vertex.color = betweenness(phage), vertex.shape = vertex)
And I get the following error:
Error in .igraph.shapes[[shape[el[x, 1]]]] :
wrong arguments for subsetting an environment
Could you please help me?