Philip Leifeld
Philip Leifeld


I have written several software packages. An overview is presented below. My main development homepage is my GitHub profile, where you find up-to-date development information and where you can ask questions, file bug reports, look at the documentation, and download the latest versions of my programs.

Discourse Network Analyzer (DNA)

The Java software Discourse Network Analyzer (DNA) is a qualitative content analysis tool with network export facilities. You import text files and annotate statements that persons or organizations make, and the program will return network matrices of actors connected by shared concepts. There is also an R package called rDNA for integration with the statistical computing environment R. The most recent version is the new DNA 2.0.

You can find lots of information including screenshots and a user manual on the project homepage on GitHub:

I wrote the Discourse Network Analyzer for my PhD project on "Discourse Networks and German pension politics." I won two research awards for this work and an honorable mention from the APSA Political Networks Section.

texreg: Conversion of Statistical Model Output in R to LaTeX and HTML Tables

texreg is a package for the statistical computing environment R. It can be used to create fancy tables from regression output (e.g., for publication purposes). The tables are available in several formats: LaTeX, HTML, and ASCII text.

texreg on CRAN:

Project homepage on GitHub:

Article about texreg in the Journal of Statistical Software:

xergm (including btergm and tnam)

xergm is a suite of packages for the statistical computing environment R. It implements extensions of exponential random graph models, in particular temporal exponential random graph models (TERGM) based on maximum pseudolikelihood estimation (MPLE) with bootstrapped confidence intervals, as described by Desmarais and Cranmer in an article published in Physica A. The btergm function can be used to estimate statistical network models for longitudinal (panel) data. xergm acts as a meta-package, which means that the actual functionality is distributed across several R packages (btergm, tnam, xergm.common, rem, and GERGM) and xergm merely contains dependencies on these sub-packages.

Project homepage on GitHub:

Sub-package btergm:

Sub-package tnam:

Sub-package xergm.common:

The xergm package on CRAN:


  • You can try to install the xergm package from CRAN by typing install.packages("xergm"). This will also install all required dependencies. If CRAN installation does not work for you for some reason, the following alternatives may work.
  • Download and install the MacOS or Windows binary package manually. Users of RStudio can install the package from the menu (Tools -> Install Packages...). If you do not use RStudio, instructions for manual package installation can be found here. Note that all required dependencies of xergm and its sub-packages must be installed before installing xergm manually. These dependencies are listed on the CRAN pages (see above) under "Imports".
  • If the binaries cannot be installed because you have a slightly different system than the one the binaries were compiled on (e.g., 32 bit rather than 64) or because you are running Linux, you can try to install the package from the source file. Instructions for installing R packages from source can be found here (see first answer). Users of RStudio can install the source package from the menu (Tools -> Install Packages...). Note that some build tools may need to be installed first; e.g., on MacOS, Xcode may need to be downloaded and installed before packages can be built from source. Note also that all required dependencies must be installed before installing xergm manually from source (see previous point).


This R package contains a routine for computing the independence of regulatory agencies, as described in an article by Ingold, Varone and Stokman in the Journal of European Public Policy.

Project homepage on R-Forge:

Right now, the regindep function is the only function contained in the package. However, I am planning to implement other routines for political network analysis. If you have code snippets that should go into the package or if you would like to contribute to the package, please let me know.