View source: R/subtract_networks.R
| subtract_networks | R Documentation |
Returns x - y as a netdifference object: the element-wise
difference of the two weight matrices. Works on any pair of networks; for an
edge-betweenness difference, subtract two net_edge_betweenness
results. Draw the signed difference network with cograph::splot(d)
or cograph::plot_difference(d); cograph handles the colouring and
node palette.
subtract_networks(x, y)
## S3 method for class 'netdifference'
print(x, max_print = 12L, ...)
x, y |
A |
max_print |
Integer. Rows to show in |
... |
Ignored. |
A netdifference object: a netobject whose
$weights and $difference_matrix are x - y, carrying
the source matrices $x and $y.
seqs <- data.frame(
V1 = c("A","B","A","C","B","A"), V2 = c("B","C","B","A","C","B"),
V3 = c("C","A","C","B","A","C"))
a <- build_network(seqs, method = "relative")
b <- build_network(seqs[1:4, ], method = "relative")
subtract_networks(a, b)
# edge-betweenness difference:
subtract_networks(net_edge_betweenness(a), net_edge_betweenness(b))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.