Get started with R igraph

Install and start using the igraph R package


igraph is on CRAN and can be installed from within R:

## Download and install the package

## Load package


On Linux (and other Unix-like systems, but not on OSX), a C and a C++ compiler is needed, and also the tool make. On Debian and Ubuntu Linux the build-essential package installs these.

  Optional requirements

  • On Linux (and other Unix-like systems, but not on OSX), the libxml2 library, including header files, is needed for the ability of reading GraphML files. On Ubuntu and Debian Linux the lixml2 and libxml2-dev packages are needed.
  • The tcltk R package is needed for tkplot and tkigraph to work.
  • The rgl R package is needed for rglplot to work.
  • The ape package is needed to plot nice dendrograms with plot_dendrogram


  • The igraph manual page is a good place to start.
  • Type in demo(package="igraph") (or use igraphdemo() if you have tcltk ) to get a list of demos.

 R manual pages

Note that this documentation is included in the R package. You can use library(help="igraph") or help("igraph") as a starting point.

  Latest stable version – 1.3.5

The simplest way to install the igraph R package is typing install.packages("igraph") in your R session.

If you want to download the package manually, the following link leads you to the page of the latest release on CRAN where you can pick the appropriate source or binary distribution yourself.

  Development version

Clone (or fork) the dev branch from the rigraph git repository on github.

 igraph support forum

Post your question on the igraph support forum. Make sure that you include a minimal reproducible example, complete with code and data.

 Stack Overflow

Post specific igraph questions on Stack Overflow. Make sure that you include the igraph tag and that you include a reproducible example, complete with code and data.

  Report bugs

Report bugs or suggest new features or algorithms in the GitHub issue tracker.

Your contribution is more than welcome!

  Contribute code

Send a pull request on GitHub. Please note that igraph can contain only code that is compatible with its GPL license. See our guide on contributions to the igraph R package at GitHub.