I have a network on R and I have to attach names to all vertices that have more than 3 related ties(or better, that have degree >=2, that is, 2 or more adjacent edges). In one case I have a network made of firms who collaborated with one another, and I need to assign to all vertices with degree>=3 the correspondent firm's name (which I have in the csv dataset in the column Project Company).
Asked
Active
Viewed 28 times
0
-
It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. The picture alone isn't very helpful. – MrFlick Nov 29 '18 at 16:11
-
The first thing I want to do is to calculate simply the degree of THE SINGLE vertex(ie the number of ties of vertex A) – user10722431 Nov 30 '18 at 15:34
-
Then I suggest you try out the `degree()` function. If you want anything more specific, then a reproducible example would be helpful. – MrFlick Nov 30 '18 at 16:19
-
First of all thank you for your reply. But the structure of the degree function seemes to be: degree(graph, v = V(graph)), but i tried it out many times and I always got the degrees of all vertices in the network instead of that of a specific vertex. IE if my vertices' IDs are (A,B,C,D,E), how do I calculate the degree of C?? And secondly, do I NEED ONLY A GRAPH OBJECT or can I use a network whose graph I have previously plotted? – user10722431 Dec 01 '18 at 00:29