Search list of igraph objects to return some with certain values

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Search list of igraph objects to return some with certain values

Chris Buddenhagen
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
[hidden email]

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Search list of igraph objects to return some with certain values

Jeff Newmiller
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 <[hidden email]> 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
>[hidden email]
>
> [[alternative HTML version deleted]]
>
>______________________________________________
>[hidden email] 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.

______________________________________________
[hidden email] 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.