call igraph from Mathematica through RLink
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Update, spring 2016: To access igraph from Mathematica, I recommend using IGraph/M instead of IGraphR when it has the functions you need. IGraphR is no longer being developed.


Call igraph with ease from Mathematica through RLink. RLink is available in Mathematica 9 or later.

See a short IGraphR tutorial here.


Easy automatic install:

Just evaluate Get[""]. It will install into $UserBaseDirectory and overwrite any old versions there.

Manual installation:

Download IGraphR.m and drop it into the directory opened by this command:

SystemOpen@FileNameJoin[{$UserBaseDirectory, "Applications"}]


First, make sure that you are using an R installation that has the igraph package.

On Windows, you can simply install it into Mathematica's internal R like this:


On OS X and Linux it is necessary to use an external R installation. See this guide on how to do that. Run the R version you are using outside of Mathematica and run install.packages('igraph') to install the igraph package into it.

Now you are ready to load IGraphR` in Mathematica:



In[]:= IGraph["vertex.connectivity"][CycleGraph[5]]
Out[]= {2.}

In[]:= IGraph[""][10]
Out[]= --Graph--

In[]:= IGraph["plot"][Graph[{a <-> b, b <-> c}]]


Mathematica 10 supports mixed graphs which have both directed and undirected edges. These are not supported by igraph or IGraphR.


If you encounter any problems with IGraphR, send a mail to szhorvat at


This package is provided under the MIT license. See LICENSE.txt for details.