Conversation
…rics)` faster to attach
… cutoff for six functions
…cks depart from ideal types
…valence rather than the triad census
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #18 +/- ##
==========================================
+ Coverage 82.05% 88.62% +6.56%
==========================================
Files 24 30 +6
Lines 2441 3533 +1092
==========================================
+ Hits 2003 3131 +1128
+ Misses 438 402 -36 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Releases {netrics} v0.5.0 with substantial new analytic functionality (new measures, motifs, memberships, and regularity methods), plus documentation/tutorial updates and CI/workflow maintenance.
Changes:
- Added new measures/methods/memberships (cyclicality, compactness, decay/integration centralities, blockmodel inconsistency + direct blockmodelling search, label propagation, clique/biclique participation, ego-composition motifs, RoleSim/REGE regularity).
- Refactored regular equivalence:
node_in_regular()now uses recursive similarity (regularity_*) and the prior census-based behavior is moved tonode_in_motif(). - Updated docs/tutorials/reference index, NEWS/versioning, and modernized GitHub Actions workflow action versions.
Reviewed changes
Copilot reviewed 93 out of 107 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| vignettes/articles/position.Rmd | Updates tutorial narrative and examples for net_by_inconsistency()/node_in_block() and the new regularity/motif split. |
| inst/tutorials/netrics3/position.Rmd | Mirrors the position tutorial updates for the bundled tutorial version. |
| tests/testthat/test-motif_nodes.R | Expands motif test exclusions to cover new node motifs requiring attributes. |
| tests/testthat/test-motif_net.R | Adds homophily-specific skips and attribute-only handling in motif-net tests. |
| tests/testthat/test-motif_composition.R | Adds tests for new ego-composition motifs (node_x_ties, node_x_alters, node_x_similarity, net_x_homophily). |
| tests/testthat/test-motif_cliques.R | Adds tests for node_x_clique() on one-mode and two-mode networks and empty networks. |
| tests/testthat/test-member_equivalence.R | Adds coverage for node_in_motif(), regularity methods, updated node_in_regular(), and node_in_block(). |
| tests/testthat/test-member_community.R | Adds tests for new node_in_labels() label propagation membership. |
| tests/testthat/test-measure_fit.R | Adds tests for net_by_inconsistency() and relocates fit-related tests from features. |
| tests/testthat/test-measure_features.R | Removes fit-related tests now housed under test-measure_fit.R. |
| tests/testthat/test-measure_cohesion.R | Adds tests for net_by_compactness() and direction-respecting behavior. |
| tests/testthat/test-measure_closure.R | Adds tests for net_by_cyclicality(). |
| tests/testthat/test-measure_centrality.R | Adds tests for node_by_decay(), node_by_integration(), and their centralizations. |
| R/zzz.R | Removes CRAN version-check/update prompt from .onAttach() while keeping interactive-only startup behavior. |
| R/netrics-utils.R | Introduces shared local-search perturbation helpers used by membership search algorithms. |
| R/motif_composition.R | Adds ego-composition motifs (node_x_ties, node_x_alters, node_x_similarity) and net_x_homophily(). |
| R/motif_cliques.R | Adds node_x_clique() including biclique support for two-mode networks and signed-tie handling. |
| R/method_regularity.R | Adds recursive regularity similarity methods (regularity_rolesim, regularity_rege). |
| R/member_equivalence.R | Updates node_in_regular() to use recursive regularity; adds node_in_motif() and node_in_block(). |
| R/member_community.R | Adds node_in_labels() based on igraph label propagation and documents it. |
| R/member_cliques.R | Removes duplicated perturbation helpers now centralized in R/netrics-utils.R. |
| R/measure_cohesion.R | Adds net_by_compactness() and documentation for compactness/global efficiency. |
| R/measure_closure.R | Adds net_by_cyclicality() and documentation contrasting it with transitivity. |
| R/measure_centrality_closeness.R | Adds decay and integration centralities plus decay/integration centralization functions and shared cutoff roxygen. |
| pkgdown/_pkgdown.yml | Reorganizes reference index sections to surface new measure families and pages. |
| NEWS.md | Adds v0.5.0 release notes aligned with the PR description. |
| NAMESPACE | Exports newly added functions across measures, motifs, memberships, and methods. |
| man/motif_periods.Rd | Updates .data parameter docs and adds new motif pages to “See also”. |
| man/motif_path.Rd | Updates .data parameter docs and adds new motif pages to “See also”. |
| man/motif_node.Rd | Updates .data parameter docs and adds new motif pages to “See also”. |
| man/motif_net.Rd | Updates .data parameter docs and adds new motif pages to “See also”. |
| man/motif_homophily.Rd | New Rd for net_x_homophily(). |
| man/motif_hierarchy.Rd | Updates .data parameter docs and adds new motif pages to “See also”. |
| man/motif_hazard.Rd | Updates .data parameter docs and adds new motif pages to “See also”. |
| man/motif_exposure.Rd | Updates .data parameter docs and adds new motif pages to “See also”. |
| man/motif_composition.Rd | New Rd for ego-composition motifs. |
| man/motif_clique.Rd | New Rd for node_x_clique(). |
| man/motif_brokerage_node.Rd | Updates .data parameter docs and adds new motif pages to “See also”. |
| man/motif_brokerage_net.Rd | Updates .data parameter docs and adds new motif pages to “See also”. |
| man/method_regularity.Rd | New Rd for regularity_rolesim() / regularity_rege(). |
| man/method_kselect.Rd | Updates .data parameter docs. |
| man/method_cluster.Rd | Updates .data parameter docs. |
| man/member_equivalence.Rd | Documents new node_in_motif() / node_in_block() and updated node_in_regular() signature/behavior. |
| man/member_diffusion.Rd | Updates .data parameter docs and adds new motif pages to “See also”. |
| man/member_core.Rd | Updates .data parameter docs and adds new motif pages to “See also”. |
| man/member_components.Rd | Updates .data parameter docs and adds new motif pages to “See also”. |
| man/member_community.Rd | Updates .data parameter docs and adds new motif pages to “See also”. |
| man/member_community_non.Rd | Adds node_in_labels() documentation section and references; updates .data parameter docs. |
| man/member_community_hier.Rd | Updates .data parameter docs and adds new motif pages to “See also”. |
| man/member_cliques.Rd | Updates .data parameter docs and adds new motif pages to “See also”. |
| man/member_brokerage.Rd | Updates .data parameter docs and adds new motif pages to “See also”. |
| man/measure_periods.Rd | Updates .data parameter docs and links to new measure_fit. |
| man/measure_hierarchy.Rd | Updates .data parameter docs and links to new measure_fit. |
| man/measure_fragmentation.Rd | Updates .data parameter docs and links to new measure_fit. |
| man/measure_fit.Rd | New Rd page separating “fit” measures from intrinsic “features” and documenting net_by_inconsistency(). |
| man/measure_features.Rd | Removes core/factions/modularity from “features” page and links to measure_fit. |
| man/measure_diverse_node.Rd | Updates .data parameter docs and links to new motif pages and measure_fit. |
| man/measure_diverse_net.Rd | Updates .data parameter docs and links to new motif pages and measure_fit. |
| man/measure_diffusion_node.Rd | Updates .data parameter docs and links to new motif pages and measure_fit. |
| man/measure_diffusion_net.Rd | Links to new measure_fit. |
| man/measure_diffusion_infection.Rd | Links to new measure_fit. |
| man/measure_core.Rd | Updates .data parameter docs and links to new motif pages and measure_fit. |
| man/measure_cohesion.Rd | Adds net_by_compactness() docs and updates .data parameter docs; links to measure_fit. |
| man/measure_closure.Rd | Adds net_by_cyclicality() docs and updates .data parameter docs; links to measure_fit. |
| man/measure_closure_node.Rd | Updates .data parameter docs; links to measure_fit. |
| man/measure_centralities_eigen.Rd | Updates .data parameter docs; links to measure_fit. |
| man/measure_centralities_degree.Rd | Updates .data parameter docs; links to measure_fit. |
| man/measure_centralities_close.Rd | Updates .data parameter docs; links to measure_fit. |
| man/measure_centralities_between.Rd | Updates .data parameter docs; links to measure_fit. |
| man/measure_centralisation_eigen.Rd | Updates .data parameter docs. |
| man/measure_centralisation_degree.Rd | Updates .data parameter docs. |
| man/measure_centralisation_close.Rd | Adds net_by_decay()/net_by_integration() docs and shared cutoff/decay args; updates .data parameter docs. |
| man/measure_centralisation_between.Rd | Updates .data parameter docs. |
| man/measure_central_eigen.Rd | Updates .data parameter docs; links to new motif pages and measure_fit. |
| man/measure_central_degree.Rd | Updates .data parameter docs; links to new motif pages and measure_fit. |
| man/measure_central_close.Rd | Adds node_by_decay()/node_by_integration() docs and shared cutoff/decay args; updates .data parameter docs. |
| man/measure_central_between.Rd | Updates .data parameter docs; links to new motif pages and measure_fit. |
| man/measure_brokerage.Rd | Updates .data parameter docs; links to new motif pages and measure_fit. |
| man/measure_broker_tie.Rd | Updates .data parameter docs; links to measure_fit. |
| man/measure_broker_node.Rd | Updates .data parameter docs; links to new motif pages and measure_fit. |
| man/measure_breadth.Rd | Updates .data parameter docs; links to measure_fit. |
| man/measure_assort_node.Rd | Updates .data parameter docs; links to new motif pages and measure_fit. |
| man/measure_assort_net.Rd | Updates .data parameter docs; links to new motif pages and measure_fit. |
| man/mark_triangles.Rd | Updates .data parameter docs. |
| man/mark_ties.Rd | Updates .data parameter docs. |
| man/mark_select_tie.Rd | Updates .data parameter docs. |
| man/mark_select_node.Rd | Updates .data parameter docs; links to new motif pages. |
| man/mark_nodes.Rd | Updates .data parameter docs; links to new motif pages. |
| man/mark_dyads.Rd | Updates .data parameter docs. |
| man/mark_diff.Rd | Updates .data parameter docs; links to new motif pages. |
| man/mark_degree.Rd | Updates .data parameter docs; links to new motif pages. |
| man/mark_core.Rd | Updates .data parameter docs; links to new motif pages. |
| man-roxygen/param_data.R | Updates shared .data parameter roxygen template to reference stocnet and as_stocnet(). |
| man-roxygen/param_cutoff.R | New shared cutoff parameter template used across multiple docs. |
| DESCRIPTION | Bumps package version to 0.5.0. |
| .Rbuildignore | Ignores Rplots.pdf artifacts in package builds. |
| .gitignore | Adds Rplots.pdf to git ignores. |
| .github/workflows/pushrelease.yml | Updates actions to newer majors and fixes checkout path usage. |
| .github/workflows/prchecks.yml | Updates actions to newer majors. |
| .github/CONTRIBUTING.md | Adds explicit naming conventions for method-helper families and membership naming guidance. |
Files not reviewed (7)
- man/mark_core.Rd: Generated file
- man/mark_degree.Rd: Generated file
- man/mark_diff.Rd: Generated file
- man/mark_dyads.Rd: Generated file
- man/mark_nodes.Rd: Generated file
- man/mark_select_node.Rd: Generated file
- man/mark_select_tie.Rd: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| dists <- igraph::distances(manynet::as_igraph(.data), | ||
| mode = match.arg(direction)) | ||
| diag(dists) <- Inf # exclude self from own score | ||
| out <- rowSums(decay^(dists-1), na.rm = TRUE) # unreachable contribute 0 | ||
| if(normalized) out <- out/(manynet::net_nodes(.data)-1) |
…rection = "out")`
…cay()` as a shortcut for decay centrality
… silently returning unweighted scores for weighted networks
…of all applicable algorithms
…()` erroring on networks holding signs as negative weights
|
Two things I ran into in
cluster_hierarchical <- ... manynet::to_correlation(t(motif)) # n x n (nodes)
cluster_cosine <- ... manynet::to_cosine(motif) # F x F (features)So node_in_structural(ison_algebra, cluster = "cosine")
#> 4 groups
#> V1 V2 V3 V4 ...
#> length 96, for a 16-node network96 is The bug is invisible whenever the census happens to be square.
The The one-step version is I think more established: It might be intentional: clustering the rows of a similarity matrix is not unusual, and It also isn't purely cosmetic: |



Description
Package
.onAttach()makinglibrary(netrics)faster to attach{migraph}, where it is cached and checks GitHub as well as CRANactions/actions/checkout, a doubled path segment that would have failed every step using itparam_cutoffroxygen template, correctly documenting geodesic cutoff for six functionsMeasures
net_by_cyclicality()for detecting generalised exchangenet_by_compactness()for the average closeness of all pairs of nodesnode_by_decay()andnet_by_decay()for decay centrality, whichweights alters by distance instead of truncating at a cutoff
node_by_integration()andnet_by_integration()for Valente andForeman's integration and radiality
than reusing
net_by_reach()'s denominator, which assumes scores boundedby N-1 and would return negative values here
net_by_inconsistency(), which scores how far a partition's blocks departfrom ideal types (
nul,com,reg,rdo,cdo,dnc), generalisingnet_by_factions()beyond structural equivalenceMemberships
node_in_labels()for label propagation community detectionnode_in_regular()to compute regular equivalence using recursivesimilarity (
regularity = "rolesim"(default) or"rege") between nodesrather than a triad census
node_in_regular()will now return more correct resultsnode_in_regular()tonode_in_motif(),documented as capturing similarity of local embedding not role equivalence
node_in_block()for direct blockmodelling, searching partitionsfor the one that minimises
net_by_inconsistency()Motifs
node_x_clique(), returning which maximal cliques each node belongs to,and branching on two-mode networks to find bicliques (closes Clique census functions #8, thanks @noortjemay)
node_x_clique()considers only positive ties,since a clique is a cohesive subgroup
node_x_ties(), describing the distribution of each node's tie values,or its spread across layers in a multiplex network
node_x_alters()andnode_x_similarity(), describing the compositionof each node's alters and their similarity to it, each branching on whether
the attribute given is categorical or continuous
node_x_similarity()compares each node with thoseat distance two, that is, those it shares a node of the other mode with,
following the tertius effect of
{migraph}and{goldfish}(Haunss and Hollway 2023)
net_x_homophily(), returning the table behind the EI index togetherwith an expected-EI baseline and Yule's Q
net_by_heterophily()sums weights, so the two agree only when unweightedMethods
regularity_rolesim()andregularity_rege(), recursive role similarity methodsregularity_rege()degenerate on unweighted connected ones, where it warnsTutorials
node_in_regular()for regular equivalence rather than the triad censusChecklist: