Voici un exemple:graph.intersection ne fonctionne pas dans igraph
df1 <- graph.data.frame(V1=c(1,1,2,2,3,4), V2=c(2,3,3,5,5,5))
g1 <- graph.data.frame(df1, directed=F)
df2 <- data.frame(V1=c(1,2,2,3,4), V2=c(3,3,5,5,5))
g2 <- graph.data.frame(df2, directed=F)
df3 <- data.frame(V1=c(1,2,3,4), V2=c(3,3,5,5))
g3 <- graph.data.frame(df3, directed=F)
df4 <- data.frame(V1=c(1,1,2,3), V2=c(2,3,4,5))
g4 <- graph.data.frame(df4, directed=F)
maintenant créer une liste
mylist <- list(g1, g2, g3, g4)
Et regardez maintenant l'intersection
res <- intersection(mylist, keep.all.vertices=FALSE)
mais je me suis ce résultat étrange:
Error in useMethod(intersection): no applicable method for 'intersection' applied to an object of class list
Toute aide avec être apprécié, je me sers igraph version 1.0.1
Au lieu de cela, il suffit d'utiliser 'intersection (g1, g2, g3, g4, keep.all.vertices = FAUX)' – G5W
oui, cela fonctionne, mais j'ai 700 graphiques et ils indiquent dans le manuel '... \t objets graphiques ou des listes d'objets graphiques . »donc je voulais savoir si c'est un bug ou quelque chose avec mon code – user2380782