Re: [R] Number of edges in a graph

From: Petr Savicky <>
Date: Mon, 21 Mar 2011 10:18:22 +0100

On Sun, Mar 20, 2011 at 10:02:10PM -0700, kparamas wrote:
> Hi,
> I have a igraph graph object.
> g <-, 100, 5, 0.05)
> If I have the summary of g, it prints
> > summary(g)
> Vertices: 100
> Edges: 500
> Directed: FALSE
> No graph attributes.
> No vertex attributes.
> No edge attributes.
> How to print only the number of edges in g?


The function is probably from an extension package. Can you send the name of the package and a reproducible code to generate a simple example of the graph?

Try str(g). This shows the names of the components of object g, which can then be used to extract only some of them.

Hope this helps.

Petr Savicky. mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon 21 Mar 2011 - 09:23:06 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 21 Mar 2011 - 09:50:23 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive