{"id":48208619,"url":"https://github.com/stocnet/netrics","last_synced_at":"2026-04-04T18:40:03.436Z","repository":{"id":342045413,"uuid":"1109937102","full_name":"stocnet/netrics","owner":"stocnet","description":"Many Ways to Measure and Classify Membership for Networks, Nodes, and Ties","archived":false,"fork":false,"pushed_at":"2026-04-04T08:24:39.000Z","size":1269,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-04T09:35:27.584Z","etag":null,"topics":["centrality","community-detection","network-analysis","r","resilience","topology"],"latest_commit_sha":null,"homepage":"https://stocnet.github.io/netrics/","language":"R","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":"2025-12-04T13:45:13.000Z","updated_at":"2026-03-22T06:16:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/stocnet/netrics","commit_stats":null,"previous_names":["stocnet/netrics"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/stocnet/netrics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stocnet%2Fnetrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stocnet%2Fnetrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stocnet%2Fnetrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stocnet%2Fnetrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stocnet","download_url":"https://codeload.github.com/stocnet/netrics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stocnet%2Fnetrics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31409469,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["centrality","community-detection","network-analysis","r","resilience","topology"],"created_at":"2026-04-04T18:40:01.644Z","updated_at":"2026-04-04T18:40:03.424Z","avatar_url":"https://github.com/stocnet.png","language":"R","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(netrics)\nlist_functions \u003c- function(string){\n  paste0(\"`\", paste(paste0(ls(\"package:netrics\")[grepl(string, ls(\"package:netrics\"))], \"()\"), collapse = \"`, `\"), \"`\")\n}\nlist_data \u003c- function(string){\n  paste0(\"`\", paste(paste0(ls(\"package:netrics\")[grepl(string, ls(\"package:netrics\"))]), collapse = \"`, `\"), \"`\")\n}\n```\n\n# netrics \n\u003cimg src=\"man/figures/logo.png\" align=\"right\" alt=\"netrics logo\" 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/netrics)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/stocnet/netrics)\n![GitHub Release Date](https://img.shields.io/github/release-date/stocnet/netrics)\n[![Codecov test coverage](https://codecov.io/gh/stocnet/netrics/branch/main/graph/badge.svg)](https://app.codecov.io/gh/stocnet/netrics?branch=main)\n\u003c!-- badges: end --\u003e\n\n## About the package\n\n`{netrics}` is the analytic engine of the [stocnet](https://github.com/stocnet) ecosystem.\nIt provides _many_ tools for marking, measuring, and identifying nodes' motifs and memberships\nin _many_ (if not most) types and kinds of networks.\nAll functions operate on matrices, `{igraph}`, `{network}`, `{tidygraph}`, and `mnet` class objects,\nand recognise directed, weighted, multiplex, multimodal, signed, and other types of networks.\n\n`{netrics}` depends on [`{manynet}`](https://stocnet.github.io/manynet/),\nwhich handles working with different network classes, converting between them, and modifying them.\nNetwork-level logical tests (e.g. `is_directed()`, `is_twomode()`) remain in `{manynet}`,\nwhile node- and tie-level analytic marks (e.g. `node_is_*()`, `tie_is_*()`) are in `{netrics}`.\nFor graph drawing, see [`{autograph}`](https://stocnet.github.io/autograph/),\nand for further testing and modelling capabilities\nsee [`{migraph}`](https://stocnet.github.io/migraph/).\n\n- [Marking](#marking)\n- [Measures](#measures)\n- [Memberships](#memberships)\n- [Motifs](#motifs)\n- [Analysis](#analysis)\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## Marking\n\n`{netrics}` includes four special groups of functions, \neach with their own pretty `print()` and `plot()` methods:\nmarks, measures, motifs, and memberships.\nMarks are logical scalars or vectors, measures are numeric, \nmemberships categorical, and motifs result in tabular outputs.\n\n`{netrics}`'s `node_is_*()` and `tie_is_*()` functions offer fast logical tests\nof node- and tie-level properties.\n`node_is_*()` returns a logical vector the length of the number of nodes in the network,\nand `tie_is_*()` returns a logical vector the length of the number of ties in the network.\nNote that network-level tests such as `is_directed()` and `is_twomode()` are in `{manynet}`.\n\n- `r list_functions(\"^node_is_\")`\n- `r list_functions(\"^tie_is_\")`\n\nThe `*is_max()` and `*is_min()` functions are used to identify\nthe maximum or minimum, respectively, node or tie according to some measure (see below).\n\n## Measures\n\n`{netrics}`'s `*_by_*()` functions offer numeric measures at the network, node, and tie level.\nThese include:\n\n- `r list_functions(\"_by_\")`\n\nThe measures are organised into several broad categories, including:\n_Centrality_, _Cohesion_, _Hierarchy_, _Innovation_ (structural holes),\n_Diversity_ (heterogeneity), _Topology_ (features), and _Diffusion_.\nEach measure recognises whether the network is directed or undirected,\nweighted or unweighted, one-mode or two-mode,\nand returns normalized values wherever possible.\nWe recommend you explore [the list of functions](https://stocnet.github.io/netrics/reference/index.html) to find out more.\n\n## Memberships\n\n`{netrics}`'s `*_in_*()` functions identify nodes' membership in some grouping,\nsuch as a community or component.\nThese functions always return a character vector, \nindicating e.g. that the first node is a member of group \"A\", the second in group \"B\", etc.\n\n- `r list_functions(\"_in_\")`\n\nFor example `node_in_brokering()` returns \nthe frequency of nodes' participation in \nGould-Fernandez brokerage roles for a one-mode network,\nand the Jasny-Lubell brokerage roles for a two-mode network.\n\nThese can be analysed alone, or used as a profile for establishing equivalence.\n`{netrics}` offers both HCA and CONCOR algorithms,\nas well as elbow, silhouette, and strict methods for _k_-cluster selection.\n\n\u003cimg src=\"https://www.jameshollway.com/post/migraph/dendroPlot.png\" alt=\"Plot of a dendrogram of structural equivalence\"/\u003e\n\n`{netrics}` also includes functions for establishing membership on other bases,\nsuch as typical community detection algorithms, \nas well as component and core-periphery partitioning algorithms.\n\n## Motifs\n\n`{netrics}`'s `*_x_*()` functions tabulate nodes' and networks' frequency in various motifs.\nThese include:\n\n- `r list_functions(\"_x_\")`\n\n## Analysis\n\nThe functions in `{netrics}` are designed to answer a wide variety of analytic questions about networks.\nFor example, you might want to know about:\n\n- _Centrality_: `r list_functions(\"degree|betweenness|closeness|eigenvector\")`\n- _Cohesion_: `r list_functions(\"density|reciprocity|transitivity|equivalency|congruency\")`\n- _Hierarchy_: `r list_functions(\"hierarchy|connectedness|upper|efficiency|reciprocity\")`\n- _Topology_: `r list_functions(\"core|factions|modularity|smallworld|balance|richclub\")`\n- _Resilience_: `r list_functions(\"cutpoint|bridge|hesion|articul\")`\n- _Brokerage_: `r list_functions(\"broke|hole|redundancy|constraint|effsize\")`\n- _Diversity_: `r list_functions(\"diversity|phily|richness|assort\")`\n- _Diffusion_: `r list_functions(\"adopt|infect|expos\")`\n\n## Installation\n\n### Stable\n\nThe easiest way to install the latest stable version of `{netrics}` is via CRAN.\nSimply open the R console and enter:\n\n`install.packages('netrics')`\n\n`library(netrics)` will then load the package and make the functions contained within the package available.\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.\nThe latest binary releases for all major OSes -- Windows, Mac, and Linux -- \ncan be found [here](https://github.com/stocnet/netrics/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/netrics_winOS.zip\", repos = NULL)`\n- For Mac: `install.packages(\"~/Downloads/netrics_macOS.tgz\", repos = NULL)`\n- For Unix: `install.packages(\"~/Downloads/netrics_linuxOS.tar.gz\", repos = NULL)`\n\nTo install from source the latest main version of `{netrics}` from Github, \nplease install the `{remotes}` package from CRAN and then:\n\n- For latest stable version: \n`remotes::install_github(\"stocnet/netrics\")`\n- For latest development version: \n`remotes::install_github(\"stocnet/netrics@develop\")`\n\n### Other sources\n\nThose using Mac computers may also install using Macports:\n\n`sudo port install R-netrics`\n\n## Relationship to other packages\n\n`{netrics}` is part of the [stocnet](https://github.com/stocnet) ecosystem of R packages\nfor network analysis.\nThe packages are designed to be modular, with clear roles and dependencies:\n\n- [`{manynet}`](https://stocnet.github.io/manynet/): \n  The foundation package for working with network data.\n  It handles network classes (matrices, `{igraph}`, `{network}`, `{tidygraph}`, `mnet`), \n  coercion between them, modification, and network-level logical tests (`is_*()` functions).\n- **`{netrics}`**: \n  The analytic package containing all measures (`*_by_*()` functions),\n  memberships (`*_in_*()` functions), motifs (`*_x_*()` functions), \n  and node- and tie-level marks (`node_is_*()`, `tie_is_*()` functions).\n  `{netrics}` depends on `{manynet}`.\n- [`{autograph}`](https://stocnet.github.io/autograph/): \n  The graph drawing package.\n  `{autograph}` depends on both `{manynet}` (for network classes)\n  and `{netrics}` (for analytic results to visualise),\n  since it would typically be used with both.\n- [`{migraph}`](https://stocnet.github.io/migraph/): \n  The modelling and testing package, \n  building on both `{manynet}` and `{netrics}`.\n\nNode- and tie-level marks such as `node_is_cutpoint()` and `tie_is_bridge()` are kept\nin `{netrics}` rather than `{manynet}` because they are analytic functions that identify\nstructural positions in the network.\nNetwork-level property tests like `is_directed()` remain in `{manynet}`\nbecause they describe the type of data rather than an analytic result.\n\n## Funding details\n\nDevelopment 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%2Fnetrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstocnet%2Fnetrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstocnet%2Fnetrics/lists"}