{"id":31041745,"url":"https://github.com/stocnet/migraph","last_synced_at":"2026-04-04T11:10:49.409Z","repository":{"id":36973577,"uuid":"238751844","full_name":"stocnet/migraph","owner":"stocnet","description":"Inferential Methods for Multimodal and Other Networks","archived":false,"fork":false,"pushed_at":"2025-09-10T14:37:50.000Z","size":409847,"stargazers_count":41,"open_issues_count":4,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-10T18:39:39.034Z","etag":null,"topics":["cran","igraph","multilevel-networks","multimodal-network","network-analysis","r","sna"],"latest_commit_sha":null,"homepage":"https://stocnet.github.io/migraph/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stocnet.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-02-06T18:04:39.000Z","updated_at":"2025-06-20T14:34:26.000Z","dependencies_parsed_at":"2023-10-10T19:39:02.181Z","dependency_job_id":"0e4a5234-79ba-4f43-982d-2706c7203cc2","html_url":"https://github.com/stocnet/migraph","commit_stats":{"total_commits":1872,"total_committers":12,"mean_commits":156.0,"dds":"0.32692307692307687","last_synced_commit":"650b5c53f5f9c4db2bac955ea1f0672ab7fb9d62"},"previous_names":["stocnet/migraph","snlab-ch/migraph"],"tags_count":90,"template":false,"template_full_name":null,"purl":"pkg:github/stocnet/migraph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stocnet%2Fmigraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stocnet%2Fmigraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stocnet%2Fmigraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stocnet%2Fmigraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stocnet","download_url":"https://codeload.github.com/stocnet/migraph/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stocnet%2Fmigraph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274913717,"owners_count":25372926,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cran","igraph","multilevel-networks","multimodal-network","network-analysis","r","sna"],"created_at":"2025-09-14T10:40:38.973Z","updated_at":"2026-04-04T11:10:49.385Z","avatar_url":"https://github.com/stocnet.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\nlibrary(migraph)\nlist_functions \u003c- function(string){\n  paste0(\"`\", paste(paste0(ls(\"package:migraph\")[grepl(string, ls(\"package:migraph\"))], \"()\"), collapse = \"`, `\"), \"`\")\n}\nlist_data \u003c- function(string){\n  paste0(\"`\", paste(paste0(ls(\"package:migraph\")[grepl(string, ls(\"package:migraph\"))]), collapse = \"`, `\"), \"`\")\n}\n```\n\n# migraph \u003cimg src=\"man/figures/logo.png\" alt=\"migraph logo\" align=\"right\" width=\"150\"/\u003e\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html#maturing)\n![CRAN/METACRAN](https://img.shields.io/cran/v/migraph)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/stocnet/migraph)\n![GitHub Release Date](https://img.shields.io/github/release-date/stocnet/migraph)\n[![Codecov test coverage](https://codecov.io/gh/stocnet/migraph/branch/main/graph/badge.svg)](https://app.codecov.io/gh/stocnet/migraph?branch=main)\n\u003c!-- [![CodeFactor](https://www.codefactor.io/repository/github/stocnet/migraph/badge)](https://www.codefactor.io/repository/github/stocnet/migraph) --\u003e\n[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4559/badge)](https://bestpractices.coreinfrastructure.org/projects/4559)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7076396.svg)](https://doi.org/10.5281/zenodo.7076396)\n\u003c!-- see https://zenodo.org/record/7076396 --\u003e\n\u003c!-- ![GitHub All Releases](https://img.shields.io/github/downloads/stocnet/migraph/total) --\u003e\n\u003c!-- badges: end --\u003e\n\n## About the package\n\nMost commonly used R packages available for network analysis,\nsuch as `{igraph}` or `{sna}`,\nare mainly oriented around directed or undirected one-mode networks.\nBut researchers are increasingly interested in analysing multimodal (one-, two-, or three-mode), multilevel (connected multimodal networks), or multilayer (multiplex or signed) networks.\nExisting procedures typically involve 'projecting' them into one-mode networks so that they can be used with those tools,\nbut thereby potentially losing important structural information,\nor require one or more other specific packages.\nTranslating between packages various syntaxes and expectations can introduce significant transaction costs though,\ndriving confusion, inefficiencies, and errors.\n`{migraph}` includes functions for inferential network analysis.\n\n`{migraph}` builds upon [`{manynet}`](https://stocnet.github.io/manynet/) to offer smart solutions to these problems.\nSince it is based on `{manynet}`, every function works for any compatible network format\n- from base R matrices or edgelists as data frames, \n[`{igraph}`](https://igraph.org/r/),\n[`{network}`](https://statnet.org), or \n[`{tidygraph}`](https://tidygraph.data-imaginist.com/index.html) objects.\nThis means it is compatible with your existing workflow, \nis extensible by other packages, \nand uses the most efficient algorithm available for each task.\n\n- [About the package](#about-the-package)\n  - [Package background](#package-background)\n- [How does migraph help?](#how-does-migraph-help)\n- [Tutorials](#tutorials)\n- [Installation](#installation)\n  - [Stable](#stable)\n  - [Development](#development)\n- [Relationship to other packages](#relationship-to-other-packages)\n- [Funding details](#funding-details)\n\n### Package background\n\n\u003cimg style=\"border:10px solid white;\" src=\"https://jameshollway.com/media/9781108833509pvs01.jpg\" align=\"left\" alt=\"Cover image of the book Multimodal Political Networks\" width=\"125\"/\u003e\n\nThe package is intended as a software companion to the book:\n\n\u003e David Knoke, Mario Diani, James Hollway, and Dimitris Christopoulos (2021) [*Multimodal Political Networks*](https://www.cambridge.org/core/books/multimodal-political-networks/43EE8C192A1B0DCD65B4D9B9A7842128).\nCambridge University Press: Cambridge.\n\nMost datasets used in the book are included in this package,\nand `{manynet}` and `{migraph}` together implement most methods discussed in the book.\nSince many of theses datasets and routines are discussed and analysed more there,\nif you like the package(s) please check out the book, and vice versa.\n\n## How does migraph help?\n\n`{migraph}` allows the testing of `{manynet}` measures against \nconditional uniform graph (CUG) or quadratic assignment procedure (QAP) distributions using:\n\n- `r list_functions(\"^test_\")`\n\n\u003cimg src=\"https://www.jameshollway.com/post/migraph/tests-2.png\" alt=\"Plot showing the results of a QAP test\"/\u003e\n\nHypotheses can also be tested within multivariate models\nvia multiple (linear or logistic) regression QAP:\n\n- `network_reg()`\n\n\u003cimg src=\"https://www.jameshollway.com/post/migraph/regression-1.png\" alt=\"A violin plot showing the results of an MRQAP\"/\u003e\n\n`{migraph}` is the only package that offers these testing frameworks \nfor two-mode networks as well as one-mode networks.\n\n## Tutorials\n\nThis package makes available interactive `{learnr}` tutorials to help new and \nexperienced users learn how they can conduct social network analysis using the \nstocnet packages.\nThe easiest way to access the tutorials is via `run_tute()`.\nIf no tutorial name is provided, the function will return a list of tutorials\ncurrently available in either package:\n\n```{r learnr-tutes}\nlibrary(migraph)\nrun_tute()\n# run_tute(\"tutorial5\")\n```\n\nFor more details on the `{learnr}` package, see [here](https://rstudio.github.io/learnr/).\n\n## Installation\n\n### Stable\n\nThe easiest way to install the latest stable version of `{migraph}` is via CRAN.\nSimply open the R console and enter:^[Macs with Macports installed may also install from the command line [using Macports](https://ports.macports.org/port/R-migraph/).]\n\n`install.packages('migraph')`\n\nYou can then begin to use `{migraph}` by loading the package:\n\n`library(migraph)`\n\nThis will load any required packages and make the data contained within the package available.\n\n`{migraph}` relies on some packages only for one or two rather specific functions.\nBy default these are not installed together with `{migraph}`,\nbut we make it easy to install them as and when needed for the first time with a console prompt.\nIf you would prefer not to encounter these prompts,\nor plan to use the package for the first time through tutorials,\nyou can make sure all the dependencies are installed with:\n\n`install.packages('migraph', dependencies = TRUE)`\n\n### Development\n\nFor the latest development version, \nfor slightly earlier access to new features or for testing,\nyou may wish to download and install the binaries from Github\nor install from source locally.\n\nThe latest binary releases for all major OSes -- Windows, Mac, and Linux -- \ncan be found [here](https://github.com/stocnet/migraph/releases/latest).\nDownload the appropriate binary for your operating system,\nand install using an adapted version of the following commands:\n\n- For Windows: `install.packages(\"~/Downloads/migraph_winOS.zip\", repos = NULL)`\n- For Mac: `install.packages(\"~/Downloads/migraph_macOS.tgz\", repos = NULL)`\n- For Unix: `install.packages(\"~/Downloads/migraph_linuxOS.tar.gz\", repos = NULL)`\n\nTo install from source the latest main version of `{migraph}` from Github, \nplease install the `{remotes}` or `{devtools}` package from CRAN and then:\n\n- For latest stable version: \n`remotes::install_github(\"stocnet/migraph\")`\n- For latest development version: \n`remotes::install_github(\"stocnet/migraph@develop\")`\n\n### Other sources\n\nThose using Mac computers may also install using Macports:\n\n`sudo port install R-migraph`\n\n## Relationship to other packages\n\n`{migraph}` draws together, updates, and builds upon many functions currently available in\nother excellent R packages such as \n[`{bipartite}`](https://github.com/biometry/bipartite), \n[`{multinet}`](https://CRAN.R-project.org/package=multinet), \n[`{tnet}`](https://toreopsahl.com/tnet/),\nand [`{xUCINET}`](https://sites.google.com/view/asnr-2022/xucinet?authuser=0).\n\n## Funding details\n\nMost work on this package has been funded by the Swiss National Science Foundation (SNSF)\n[Grant Number 188976](https://data.snf.ch/grants/grant/188976): \n\"Power and Networks and the Rate of Change in Institutional Complexes\" (PANARCHIC).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstocnet%2Fmigraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstocnet%2Fmigraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstocnet%2Fmigraph/lists"}