This package allows to pass network objects to
ggplot2 and provides geometries to plot their
You can install the released version of
And the development version from GitHub with:
# install.packages("remotes") remotes::install_github("briatte/ggnetwork")
ggnetwork package depends on R 3.5+ and on
- The package vignette
contains detailed examples of how to use its
fortifymethod and each of its geometries.
- The package website has more information and a list of all package functions.
For further examples that use
ggnetwork with other packages to produce
animated graphs, see James Curley’s slides on “Interactive and Dynamic
Network Visualization in
R” (2016). For even more
options, see Katherine Ognyanova’s tutorial “Network visualization with
R (2019), and David Schoch’s
guide “Network Visualizations in R using
If you encounter a clear bug, please file a minimal reproducible example on GitHub.
For questions and other discussion, please contact the package maintainer, or ask other users on Stack Overflow.
You can get a citation for the package from R:
ggnetwork package was written within a larger development effort
around network visualization with
ggplot2, on which you can read the
Sam Tyner, François Briatte and Heike Hofmann, “Network Visualization with
ggplot2,” The R Journal 9(1): 27–59, 2017.
The article also covers the related packages
ggnet. It does not cover the more
tidygraph, although you
should turn to those if you need a highly extensive way to build and
plot ‘tidy’ networks with
Thanks to @achmurzy,
@zachcp and two anonymous R
@ethen8181 also helped with the tricky
issue of having arrows on directed edges, while
@sumtxt inspired this package as well as
its predecessor, the
ggnet package, which also benefitted from
discussions with @pedroj and Bertrand
Please note that this project is released with a Contributor Code of
By participating in this project you agree to abide by its terms.