make_random | R Documentation |
These functions are similar to the create_*
functions,
but include some element of randomisation.
They are particularly useful for creating a distribution of networks
for exploring or testing network properties.
generate_random()
generates a random network with ties appearing at some probability.
generate_configuration()
generates a random network consistent with a
given degree distribution.
generate_man()
generates a random network conditional on the dyad census
of Mutual, Asymmetric, and Null dyads, respectively.
generate_utilities()
generates a random utility matrix.
These functions can create either one-mode or two-mode networks.
To create a one-mode network, pass the main argument n
a single integer,
indicating the number of nodes in the network.
To create a two-mode network, pass n
a vector of two integers,
where the first integer indicates the number of nodes in the first mode,
and the second integer indicates the number of nodes in the second mode.
As an alternative, an existing network can be provided to n
and the number of modes, nodes, and directedness will be inferred.
generate_random(n, p = 0.5, directed = FALSE, with_attr = TRUE)
generate_configuration(.data)
generate_man(n, man = NULL)
generate_utilities(n, steps = 1, volatility = 0, threshold = 0)
generate_permutation(.data, with_attr = TRUE)
n |
Given:
|
p |
Proportion of possible ties in the network that are realised or, if integer greater than 1, the number of ties in the network. |
directed |
Whether to generate network as directed. By default FALSE. |
with_attr |
Logical whether any attributes of the object should be retained. By default TRUE. |
.data |
An object of a manynet-consistent class:
|
man |
Vector of Mutual, Asymmetric, and Null dyads, respectively.
Can be specified as proportions, e.g. |
steps |
Number of simulation steps to run. By default 1: a single, one-shot simulation. If more than 1, further iterations will update the utilities depending on the values of the volatility and threshold parameters. |
volatility |
How much change there is between steps.
Only if volatility is more than 1 do further simulation steps make sense.
This is passed on to |
threshold |
This parameter can be used to mute or disregard stepwise changes in utility that are minor. The default 0 will recognise all changes in utility, but raising the threshold will mute any changes less than this threshold. |
By default a tbl_graph
object is returned,
but this can be coerced into other types of objects
using as_edgelist()
, as_matrix()
,
as_tidygraph()
, or as_network()
.
By default, all networks are created as undirected.
This can be overruled with the argument directed = TRUE
.
This will return a directed network in which the arcs are
out-facing or equivalent.
This direction can be swapped using to_redirected()
.
In two-mode networks, the directed argument is ignored.
Erdos, Paul, and Alfred Renyi. 1959. "On Random Graphs I" Publicationes Mathematicae. 6: 290–297.
Bollobas, Bela. 1980. "A Probabilistic Proof of an Asymptotic Formula for the Number of Labelled Regular Graphs". European Journal of Combinatorics 1: 311-316.
Holland, Paul W., and Samuel Leinhardt. 1976. “Local Structure in Social Networks.” In D. Heise (Ed.), Sociological Methodology, pp 1-45. San Francisco: Jossey-Bass.
Other makes:
make_cran
,
make_create
,
make_ego
,
make_explicit
,
make_learning
,
make_motifs
,
make_play
,
make_read
,
make_stochastic
,
make_write
graphr(generate_random(12, 0.4))
# graphr(generate_random(c(6, 6), 0.4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.