Question

Assign during add.edges() an attribute, like width:

g <- add.edges(g,c(from,to), attr= width <- 1 ) 

Error message:
please supply names for attributes
Was it helpful?

Solution

You need to assign it a named list:

g <- graph.adjacency(matrix(0,2,2))
g <- add.edges(g,c(1,2),attr=list(width=10))

With the code you used you assign 1 to a variable width and then assign the value of width, i.e. 1, to the argument attr.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top