Description Usage Arguments Details Value See Also Examples
Compare or test network objects for (near) equality.
1 | netcompare(target, current, test = FALSE, ...)
|
target,current |
network objects, currently
|
test |
logical, whether to perform the test or return comparison data, see Details |
... |
other arguments, currently ignored |
Arguments target
and current
can be network
objects of one of the supported classes. They do not have
to be of the same class though.
The function does a series of comparisons between
target
and current
:
The network structure comparison is made based on adjacency matrices (mind this when using for huge networks).
Network/edge/vertex attributes are checked for presence in both objects.
Common network/edge/vertex attribures are checked for equality.
All the results are collected in a list
of class netcompare
with an associated
print
method.
If test
is TRUE then instead of the detailed test
results the function returns TRUE or FALSE depending on
some of the checks resulted positively. Currently
attribute checks are ignored, i.e. what is taken into
account is:
Equivalence of adjacency matrices
Directed / undirected character of the network
Edge set size
Vertex set size
Depending on the value of test
either an object of
class netcompare
containing the results of all the
tests (if test=FALSE
) or (if test=TRUE
) a
logical whether or not the networks are (nearly) the
same.
1 2 | netcompare( asIgraph(exNetwork), exNetwork)
netcompare( asIgraph(exNetwork), exNetwork, test=TRUE)
|
$class
target current
"igraph" "network"
$vcount
target current
15 15
$ecount
target current
11 11
$directed
target current
TRUE TRUE
$identical_am
[1] TRUE
$network
$n
target current
0 7
$presence
target current
bipartite FALSE TRUE
directed FALSE TRUE
hyper FALSE TRUE
loops FALSE TRUE
mnext FALSE TRUE
multiple FALSE TRUE
n FALSE TRUE
$bycomp
[1] NA
attr(,"class")
[1] "netcomparea"
$vertex
$n
target current
3 3
$presence
target current
label TRUE TRUE
na TRUE TRUE
vertex.names TRUE TRUE
$bycomp
$bycomp$label
[1] TRUE
$bycomp$na
[1] TRUE
$bycomp$vertex.names
[1] TRUE
attr(,"class")
[1] "netcomparea"
$edge
$n
target current
2 2
$presence
target current
label TRUE TRUE
na TRUE TRUE
$bycomp
$bycomp$label
[1] TRUE
$bycomp$na
[1] TRUE
attr(,"class")
[1] "netcomparea"
attr(,"class")
[1] "netcompare"
[1] TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.