[R] what would break a citation network? [Error in as.igraph.vs(graph, vids) : Invalid vertex names]

K. Elo m@||||@t@ @end|ng |rom pp@|net@||
Sun May 5 07:35:29 CEST 2019


Hi Drake,

2019-05-04, 17:34 -0700, Drake Gossi wrote:
> Hello everyone,
> 
> I'm trying to learn how to put together a citation network, and, in
> doing so, I'm playing around with a data set of my own making. I'm
> going back and forth between two .csv files. One has two columns and
> is simply labeled "to" and "from":
> 
> to from
> rickert heidegger
> rickert nietzsche
> rickert parmenides
> rickert diogenes
> rickert latour
> rickert haraway
> rickert barad
> rickert burke
> boyle mackenzie
> boyle flusser
> boyle kittler
> boyle massumi
> boyle mattern
> boyle rickert
> boyle berlant
> boyle ulmer
> boyle manovich
> boyle burke
> 
> So, rickert and boyle are academics, and the people to the right are
> other scholars they cite. This one .csv file goes on for 75 rows like
> this.
> 
> But I have another file too, which looks like this. The two columns
> are "author" and "association":
> 
> author association
> latour STS
> burke rhetoric
> kittler media theory
> heidegger philosophy
> barthes philosophy
> mackenzie media theory
> massumi affect theory
> nietzsche philosophy
> flusser media theory
> rickert rhetoric
> spinuzzi tech comm
> boyle rhetoric
> gries rhetoric
> jeff rice rhetoric
> jenny rice rhetoric
> gunn rhetoric
> rivers rhetoric
> mol STS
> stengers STS
> barad STS
> braidotti posthumanism
> wolfe posthumanism
> haraway STS
> 
> The trouble is, when I add the following (davis, rhetoric) onto the
> second list, the citation network breaks.
> 
> ...
> ...
> braidotti posthumanism
> wolfe posthumanism
> haraway STS
> davis rhetoric
> 
> My question is: why would the addition of a single row break the
> analysis? I am getting this error message:
> 
> Error in as.igraph.vs(graph, vids) : Invalid vertex names
> 
> My code is this:
> 
> install.packages("igraph")
> library(igraph)
> myEdgeList <- as.matrix(read.csv("myEdgeList.csv", as.is=TRUE))
> G <- graph.edgelist(myEdgeList, directed=FALSE)
> myThemes <- read.csv("myThemes.csv", as.is=TRUE)
> rowNumberofMatchingCases <- which(myThemes$association %in%
> c("rhetoric"
>                                                               ))
> authorsOfMatchingCases <- myThemes$author [rowNumberofMatchingCases]
> H <- induced.subgraph (G, authorsOfMatchingCases)
> lout <- layout.fruchterman.reingold(H)
> plot.igraph(H, layout=lout, vertex.size=5, vertex.label.cex=.5)
> 
> My guess is I have broken some fundamental rule of graphing, like one
> of the names performs too many functions in the graph, or I have
> "rhetoric" too many times in the is the second csv file...
> 
> But I really think the better question is: if you were just fooling
> around and trying to make a citation network from hand and by
> scratch,
> like I'm doing, what could you not do with the list? and does this
> have something to do with transitivity?
> 
> Drake

With "davis" you try to refer to a vertex (node) not existing in your
vertex list. This results in an error.

Take a look on this, if I understood your problem correctly it is a
similar issue:


https://stackoverflow.com/questions/30201510/error-with-subgraph-in-igraph-package

HTH,
Kimmo



More information about the R-help mailing list