summary.cpAlgorithm: summary.cpAlgorithm

Description Usage Arguments Details Value Author(s) Examples

View source: R/summarycpAlgorithm.R

Description

Summary method for objects of class cpAlgorithm.

Usage

1
2
3
4
5
6
## S3 method for class 'cpAlgorithm'
summary(
  object,
  details = c("communities.labels", "shared.nodes.labels", "isolated.nodes.labels"),
  ...
)

Arguments

object

An object of class cpAlgorithm; see also cpAlgorithm

details

A string or vector indicating about which part of the results more information is requested; default is c("communities.labels","shared.nodes.labels","isolated.nodes.labels"); see Details

...

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

 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
## 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"))

CliquePercolation documentation built on May 29, 2021, 5:07 p.m.