summary.cpAlgorithm {CliquePercolation} | R Documentation |
summary.cpAlgorithm
Description
Summary method for objects of class cpAlgorithm
.
Usage
## S3 method for class 'cpAlgorithm'
summary(
object,
details = c("communities.labels", "shared.nodes.labels", "isolated.nodes.labels"),
...
)
Arguments
object |
An object of class |
details |
A string or vector indicating about which part of
the results more information is requested; default is
|
... |
currently ignored |
Details
The function extracts information from an object produced by cpAlgorithm
.
To do so, the user has to specify in details
which information is requested.
It is possible to extract information about the communities with either
numbers (communities.numbers
) or labels (communities.labels
)
as identifiers of the nodes. Moreover, it is possible to extract information about
shared nodes with either numbers (shared.nodes.numbers
) or labels
(shared.nodes.labels
) as identifiers of the nodes. Finally, it is possible
to extract information about isolated nodes with either numbers
(isolated.nodes.numbers
) or labels (isolated.nodes.labels
)
as identifiers of the nodes. Any combination of these options can be specified
in details
.
Value
Prints information depending on details
.
Author(s)
Jens Lange, lange.jens@outlook.com
Examples
## Example for unweighted networks
# create qgraph object
W <- matrix(c(0,1,1,1,0,0,0,0,
0,0,1,1,0,0,0,0,
0,0,0,0,0,0,0,0,
0,0,0,0,1,1,1,0,
0,0,0,0,0,1,1,0,
0,0,0,0,0,0,1,0,
0,0,0,0,0,0,0,1,
0,0,0,0,0,0,0,0), nrow = 8, ncol = 8, byrow = TRUE)
colnames(W) <- letters[1:8]
rownames(W) <- letters[1:8]
W <- Matrix::forceSymmetric(W)
W <- qgraph::qgraph(W)
# run clique percolation for unweighted networks
results <- cpAlgorithm(W = W, k = 3, method = "unweighted")
# print results overview
results
# extract details about the communities
summary(results, details = "communities.labels")
# extract information about shared and isolated nodes
summary(results, details = c("shared.nodes.numbers", "isolated.nodes.labels"))