rbernoulli | R Documentation |
Random Bernoulli graph
rbernoulli(n, p = 0.5)
n |
Integer vector. Size of the graph. If |
p |
Probability of a tie. This may be either a scalar, or a vector of the
same length of |
If n
is a single number, a square matrix of size n
with zeros in
the diagonal. Otherwise it returns a list of length(n)
square matrices of
sizes equal to those specified in n
.
# A graph of size 4
rbernoulli(4)
# 3 graphs of various sizes
rbernoulli(c(3, 4, 2))
# 3 graphs of various sizes and different probabilities
rbernoulli(c(3, 4, 6), c(.1, .2, .3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.