Changelog
Source:NEWS.md
netkit 0.1.0
First CRAN release.
The “Breaking changes” below are relative to 0.0.1.9000, which was a development build and was never released, so nothing here changes behavior anyone could have depended on.
Breaking changes
Edge weights are now ignored unless you ask for them. Functions that can use edge weights take
weightsandweight_typearguments, andweights = NULL(the default) ignores edge weights even when the graph carries aweightattribute, warning that it is doing so. This differs from plain , which picks the attribute up automatically — and that automatic behavior was the problem: igraph reads a weight as a cost inbetweenness(),distances(),diameter()andmean_distance(), but as a strength incluster_louvain()and the other community algorithms, while netkit’s own matrix code ignored it entirely. Attaching a confidence score therefore inverted every path-based metric, was read correctly by community detection, and vanished from diffusion. See?"netkit-weights".network_diffusion_with_pvalues()now defaults to a degree-matched permutation null (null = "degree_matched"). Diffusion scores are strongly degree-dependent, so the previous uniform seed permutation reported much of the degree difference between real and permuted seeds as significance. This changes every p-value the function produces. Passnull = "uniform"for the old behavior.robustness_analysis()no longer re-seeds the random number generator on its default call. It previously ranset.seed(seed)unconditionally, so the documented defaultseed = NULLbecameset.seed(NULL), which re-seeds from the clock. Results of a default call therefore change, and a seeded script is now actually reproducible.network_diffusion_with_pvalues()had the same defect.compare_networks()$similarity$edge_overlapis redefined. It was the identical expression tojaccard_similarity— one number reported twice under two names. It is now the overlap coefficient,|E1 ∩ E2| / min(|E1|, |E2|), which is the informative companion to Jaccard when two networks differ greatly in size.calculate_roles()’s R2/R3 participation boundary is corrected from 0.60 to the 0.62 published by Guimerà and Amaral (2005), and the R5/R6 boundary is now 0.30 everywhere. Some nodes near those boundaries change role.metric_significance()andsmall_worldness()takenrather thann_null, matchingnull_model(n =). The old name was not just inconsistent: with formals callednullandn_nullside by side,metric_significance(g, n = 20)partially matched both and failed withargument 3 matches multiple formal arguments. Withna formal, it is an exact match. Then_nullcolumn ofsmall_worldness()$resultkeeps its name.
New features
node_metrics()— the node-level counterpart tosummarize_graph_metrics(). Computes degree, strength, betweenness, closeness, harmonic centrality, eigenvector centrality, PageRank, coreness, local clustering, Burt’s constraint and eccentricity in one call, and attaches each to the graph as a vertex attribute, sorobustness_analysis(removal_strategy = "pagerank")works without further steps. The default plot is a Spearman correlation heatmap of the metrics, because the usual mistake with such a table is to read highly correlated metrics as independent evidence.extract_subnetwork()— builds an interpretable subnetwork around a set of nodes, by induced subgraph, neighborhood expansion (withmax_degreeto exclude promiscuous hubs), the union of all shortest paths between seed pairs, an approximate minimum Steiner tree (Kou–Markowsky–Berman), or diffusion-based expansion reusing the existing kernel.null_model(),metric_significance()andsmall_worldness()— matched random ensembles and the tests built on them, which turnsummarize_graph_metrics()from descriptive into inferential. Empirical p-values use the(r + 1) / (n + 1)convention and are never zero.Edge weights throughout:
summarize_graph_metrics(),node_metrics(),prepare_diffusion(),network_diffusion(),network_diffusion_with_pvalues(),greedy_seed_selection(),find_hubs(),find_bottlenecks(),calculate_roles(),find_modules(),robustness_analysis(),compare_networks(),plot_CCDF()andextract_subnetwork()all acceptweightsandweight_type.network_diffusion(seed_weights =)— diffuse from a continuous signal (log fold changes, scores, prior probabilities) rather than from set membership.robustness_analysis(removal_strategy = "strength").print()methods for every object netkit returns, so that a result at the console is a summary rather than a dump. The default method printed the whole annotated graph and every row of the result table; a 100-graphnull_model()ensemble ran to over 1400 lines. Analysis results now print theirmethodline, the head ofresult, and a one-line description of each remaining element;null_model()ensembles andprepare_diffusion()kernels print their shape. Only printing changes — the objects are still plain lists, andunclass()restores the old output. See?"netkit-print".A package-level help page:
?netkitgives the function map and the shared return vocabulary.calculate_roles(thresholds =)— override the participation-coefficient boundaries between roles.
Bug fixes
calculate_roles()returnedplot,roles_definitionsandresultwith nographand nomethod, breaking the shared return vocabulary. It now annotates the graph withmodule,role_z,role_pandrole.The five role boundaries were written out three times — in the classifier, in the
roles_definitionstable handed to the caller, and in the shaded bands of the plot — and had drifted. The R5/R6 boundary was 0.30 in the classifier but 0.25 in the other two, so the shaded “provincial hub” region disagreed with the classification it illustrated. They now come from one place.network_diffusion_with_pvalues()never called the shared input validator, so the data.frame edge list it documents failed with igraph’s own error. It was also counting seeds before intersecting them with the graph’s vertices, so any absent seed made every permuted set larger than the real one, inflating the null and biasing every p-value.compare_networks()crashed on an edgeless graph.compute_ccdf()now returns an empty table for degenerate input, matchingsummarize_graph_metrics(), which reportsNaNrather than refusing.Random walk with restart used an absolute convergence threshold, so the precision achieved depended on the magnitude of the seed vector — which now matters, since
seed_weightslets callers set it. The threshold is relative tosum(abs(f0)), and the previously unbounded iteration has a cap.compare_networks()usedcat()wheremessage()was wanted.
netkit 0.0.1.9000
First development build. Never released.
netkit provides a toolkit for analyzing and visualizing networks, built on igraph and returning ggplot2 objects rather than drawing them, so that diagnostics can be composed and customized by the caller.
Features
Topology —
summarize_graph_metrics()produces a one-row table of global metrics (density, diameter, average path length, transitivity, assortativity, algebraic connectivity, degree entropy, Gini coefficient of degree, modularity).plot_CCDF()draws the complementary cumulative degree distribution on log-log axes with optional power-law reference lines, andcompare_networks()puts two graphs side by side with a Kolmogorov-Smirnov test on their degree distributions.-
Node classification —
find_hubs()(high degree and high betweenness) andfind_bottlenecks()(low degree, high betweenness) support z-score and quantile thresholding.calculate_roles()implements the Guimerà and Amaral- R1–R7 connectivity cartography from within-module degree z-scores and participation coefficients.
Community structure —
find_modules()wraps nine igraph community detection algorithms with module-size filtering and optional subgraph extraction.Diffusion —
network_diffusion()propagates influence from seed nodes by Laplacian smoothing, heat kernel, or random walk with restart.prepare_diffusion()builds a reusable kernel for repeated runs,network_diffusion_with_pvalues()adds a permutation null parallelized with future.apply, andgreedy_seed_selection()searches for the seed set that maximizes diffusion onto a target set.Robustness —
robustness_analysis()simulates progressive node removal at random, by degree, by betweenness, or by any numeric vertex attribute, and reports per-metric area under the curve.Visualization —
plot_Net()is the central renderer, withhighlight_nodes()andlayout_horizontal_tree()alongside it.assign_attributes()attaches metadata tables to a graph so that results from one function can feed the next.
Analysis functions return a named list with a consistent vocabulary — plot, result, graph, method — which is what lets them be chained.