File: netcompare.Rd

package info (click to toggle)
r-cran-intergraph 2.0-4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 392 kB
  • sloc: sh: 13; makefile: 2
file content (65 lines) | stat: -rw-r--r-- 1,991 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/netcompare.R
\name{netcompare}
\alias{netcompare}
\title{Comparing and testing network objects}
\usage{
netcompare(target, current, test = FALSE, ...)
}
\arguments{
\item{target, current}{network objects, currently \code{network} and
\code{igraph} classes are supported}

\item{test}{logical, whether to perform the test or return comparison data,
see Details}

\item{\dots}{other arguments, currently ignored}
}
\value{
Depending on the value of \code{test} either an object of class
\code{netcompare} containing the results of all the tests (if
\code{test=FALSE}) or (if \code{test=TRUE}) a logical whether or not the
networks are (nearly) the same.
}
\description{
Compare or test network objects for (near) equality.
}
\details{
Arguments \code{target} and \code{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 \code{target} and
\code{current}:

\enumerate{
\item The network structure comparison is made based on adjacency matrices
(mind this when using for huge networks).

\item Network/edge/vertex attributes are checked for presence in both
objects.

\item Common network/edge/vertex attribures are checked for equality.
}
All the results are collected in a list of class \code{netcompare} with an
associated \code{print} method.

If \code{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:

\enumerate{
\item Equivalence of adjacency matrices
\item Directed / undirected character of the network
\item Edge set size
\item Vertex set size
}
}
\examples{

netcompare( asIgraph(exNetwork), exNetwork)
netcompare( asIgraph(exNetwork), exNetwork, test=TRUE)

}
\seealso{
\code{\link{all.equal}}, \code{\link{identical}}
}