Remove Stand-alone Dyads

Hi There,

This is my first post, so please excuse any etiquette rules that I may accidentally break.

I am new to R and I am working with a very large data set that has numerous stand-alone dyads in it and I would like to remove them, so that I can focus on a small number of communities that have 3 or more nodes. Does anyone know how to do this please?


Hello and welcome.

Learning R can be difficult, as sometimes you don't know where to begin. The basics can be learned through learnr package

In regard to etiquette, andresrcs made a post some time ago with steps to provide reproducible example(s).

If you could provide some of what you currently have, it would allow us to best answer your question.

Hi Ven,

Thanks for responding. Perhaps I should mentiont that although I am new to R, I have done a few introductory courses but sometimes have a few problems with my coding. I also realise, that maybe my question was a bit to broad!

For context, I am using igraph and ddplot2.

I think I need to use an if/else statement, but I am not sure how to code it.

Here is my code so far:

vertex.label.color = "black",
vertex.label.cex = 0.9,
vertex.size = 0,
edge.color = 'gray28'.
layout =

I know I need to add an if/else statement in here somewhere, but not sure how. What I am trying to do is to remove all outlier nodes that only have an edge between itself and another. So essentially pairs of 2 or dyads. Any node that has 2 or more connections, ie a triad, I want to keep.

I have tried identifying communities, but as I said, I have a really large network that I am analysing and R has identified over 500 communities - most of them are communities of 2 and I want to remove them.

Hoepfully this explains what I need a bit more?


*edit - I am using igraph and ggplot2... :slight_smile:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.