network_utils: Utility functions for NetSim network objects

Description Usage Arguments See Also Examples

Description

Utility functions to quickly change macro features of NetSim network objects. The first function adds random ties to a network, the second function creates a ring lattice structure to a network.

Usage

1
2
	add_random_ties_to_network(network, probability = 0.5)
	add_ring_lattice_to_network(network, nReciprocalTies)

Arguments

network

A NetSim network object

probability

Bernoulli probability of a non-existing tie to be set to 1.

nReciprocalTies

The number of reciprocal ties one node has in the ring lattice structure.

See Also

create_network

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
 nActors <- 5
 network <- create_network(matrix(0, nActors, nActors))
 
 add_random_ties_to_network(network, probability = 0.5)
 add_random_ties_to_network(network, probability = 1)
 
 # reset network to an empty network
 network <- create_network(matrix(0, nActors, nActors))
 add_ring_lattice_to_network(network, nReciprocalTies = 2)
 ## Not run: 
 add_ring_lattice_to_network(network, nReciprocalTies = 0) # throws an error message
  
## End(Not run)

NetSim documentation built on May 29, 2017, 6:41 p.m.

Search within the NetSim package
Search all R packages, documentation and source code