migraph

Lifecycle: maturing CRAN/METACRAN GitHub release (latest by date) GitHub Release Date Codecov test coverage CodeFactor CII Best Practices

About the package

{migraph} works with and extends existing network analysis packages for analysing multimodal networks. It provides a common, standard syntax for working with and analysing both one-mode and two-mode networks.

The package is intended as a software companion to the book:

David Knoke, Mario Diani, James Hollway, and Dimitris Christopoulos (2021) Multimodal Political Networks. Cambridge University Press: Cambridge.

Most datasets used in the book are included in this package, and the package implements most methods discussed in the book. Since many of theses datasets and routines are discussed and analysed more there, if you like the package please check out the book, and vice versa.

How does migraph help?

Works with your current network analysis workflow

The package is offered as a complement to existing R packages for network analysis and thus tries to work well with whatever format network objects you are already working with. All {migraph} measures and models work with data in base formats:

as well as with objects constructed from the following packages:

{migraph}’s as_*() functions can be used to translate objects from one of the above classes into any other, and include:

These functions are designed to be as intuitive and lossless as possible, outperforming many other class-coercion packages.

Manipulation

Regardless of which class object you are working with, the same syntax can be used to work with and manipulate your data.

{migraph}’s is_*() functions offer fast logical tests of network properties, e.g.:

{migraph}’s to_*() functions can be used on any class object to transform networks into networks with other properties, e.g.:

Making

{migraph} includes algorithms for making both one-mode and two-mode networks with particular properties. The create_* group of functions create networks with a particular structure, e.g.:

The generate_* group of functions generate networks from particular generative mechanisms, e.g.:

{migraph} includes a number of prominent network datasets, especially multimodal and multiplex examples for demonstrating more advanced methods.

{migraph} can also import and export to Excel edgelists and nodelists, UCINET and Pajek files, e.g.:

Extends your current network analysis workflow

{migraph} offers a range of measures and models with sensible defaults. Many wrap existing functions in common packages for use with one-mode networks, but extend these to treat and/or normalise for two-mode (and sometimes three-mode) networks correctly. Functions are given intuitive and succinct names that avoid conflicts with existing function names wherever possible.

Measures

Motifs

Models

Visualization

Please explore the list of functions to find out more.

Installation

Stable

The easiest way to install the latest stable version of {migraph} is via CRAN. Simply open the R console and enter:

install.packages('migraph')

You can then begin to use {migraph} by loading the package:

library(migraph)

This will load any required packages and make the data contained within the package available. The version from CRAN also has all the vignettes built and included. You can check them out with:

vignettes(package = "migraph")

Development

For the latest development version, for slightly earlier access to new features or for testing, you may wish to download and install the binaries from Github or install from source locally.

The latest binary releases for all major OSes – Windows, Mac, and Linux – can be found here. Download the appropriate binary for your operating system, and install using an adapted version of the following commands:

To install from source the latest main version of {migraph} from Github, please install the {remotes} or {devtools} package from CRAN and then:

Relationship to other packages

It draws together, updates, and builds upon many functions currently available in other excellent R packages such as {bipartite}, {multinet}, and {tnet}, and implements many additional features currently only available outside the R ecosystem in packages such as UCINET.