generateGroups: Generate random node/edge groups.

Description Usage Arguments Details Value See Also Examples

View source: R/utils.R

Description

Generate random groups of node/edge in a network or in a set of networks.

Usage

1
generateGroups(networks, numGroups, nodeSize = 1, edgeSize = 0, newEdges = FALSE)

Arguments

networks

A network or a set of networks contain the generated groups

numGroups

Number of random groups to be generated for each network. If set to "all", all possible groups would be generated.

nodeSize

Number of nodes in each group, default is 1

edgeSize

Number of edges in each group, default is 0

newEdges

If TRUE, new edges would be created for each group. Otherwise, existing edges of the networks are selected for each group.

Details

This function generates random groups of elements in a network or in a set of networks. The groups would be used to analyze the dynamics of the examined networks, for ex., calculating sensitivity, perturbing a network, or restoring a network to the origin. Each element group contains only nodes, only edges, or a combination of nodes/edges.

Value

The updated network objects including generated groups

See Also

calSensitivity, perturb, restore

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(amrn)
# Generate all possible groups each containing a single node in the AMRN network
amrn <- generateGroups(amrn, "all", 1, 0)
print(amrn$Group_1)

# Generate all possible groups each containing a single edge in the AMRN network
amrn <- generateGroups(amrn, "all", 0, 1)
print(amrn$Group_2)

# Generate all possible groups each containing a new edge (the edge did not exist in the AMRN network)
amrn <- generateGroups(amrn, "all", 0, 1, TRUE)
print(amrn$Group_3)

csclab/RMut documentation built on May 14, 2019, 12:07 p.m.