Chris Buddenhagen
2021-Jan-05 02:08 UTC
[R] Search list of igraph objects to return some with certain values
Hi all I stochastically simulated thousands of directed igraph objects in list format. I want to find and plot an example graph that meets a certain criteria (a link to a certain node). Does anyone have pointers on how to subset a list of igraph objects? Sincerely, Chris Buddenhagen cbuddenhagen at gmail.com [[alternative HTML version deleted]]
Jeff Newmiller
2021-Jan-05 08:23 UTC
[R] Search list of igraph objects to return some with certain values
Standard logical indexing. Write a function that returns TRUE or FALSE given an igraph object. Use sapply or Vectorize to make a logical vector as long as your list. Then use that vector to index the list with single bracket indexing. On January 4, 2021 6:08:43 PM PST, Chris Buddenhagen <cbuddenhagen at gmail.com> wrote:>Hi all > >I stochastically simulated thousands of directed igraph objects in list >format. I want to find and plot an example graph that meets a certain >criteria (a link to a certain node). Does anyone have pointers on how >to >subset a list of igraph objects? > >Sincerely, > > >Chris Buddenhagen >cbuddenhagen at gmail.com > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide >http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.-- Sent from my phone. Please excuse my brevity.