You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using some of the built-in graphs types, I see an error
library(igraph)
tetra<- make_graph("Tetrahedron")
as_long_data_frame(tetra)
#> Error in names(ver) <- paste0("from_", names(ver)): 'names' attribute [1] must be the same length as the vector [0]ring<- make_ring(10)
as_long_data_frame(ring)
#> Error in names(ver) <- paste0("from_", names(ver)): 'names' attribute [1] must be the same length as the vector [0]
Making my own graph from graph_from_data_frame(), I see incorrect column names. The last two columns ought to be called from_name and to_name.
vertices<-data.frame(
id=1:10,
name=letters[1:10]
)
edges<-data.frame(
a= sample(10),
b= sample(10),
score= runif(10)
)
g<- graph_from_data_frame(edges, vertices=vertices)
as_long_data_frame(g)
#> from to score ver[el[, 1], ] ver2[el[, 2], ]#> 1 4 5 0.2277997 d e#> 2 2 4 0.1393521 b d#> 3 1 8 0.4443383 a h#> 4 7 7 0.4660912 g g#> 5 9 10 0.9414583 i j#> 6 2 6 0.1375254 b f#> 7 8 9 0.5932517 h i#> 8 3 5 0.4985059 c e#> 9 1 10 0.5559388 a j#> 10 3 6 0.7224063 c f
The text was updated successfully, but these errors were encountered:
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.
Using some of the built-in graphs types, I see an error
Making my own graph from
graph_from_data_frame()
, I see incorrect column names. The last two columns ought to be calledfrom_name
andto_name
.The text was updated successfully, but these errors were encountered: