Learn R Programming

migraph (version 0.6.2)

sample: Sample networks according to certain probabilities

Description

Sample networks according to certain probabilities

Usage

sample_affiliation(n, p, m)

Arguments

n

Integer vector of length 2. The first number is the number of nodes in the first nodeset (rows), and the second number becomes the number of nodes in the second nodeset (columns).

p

Number of edges in the network over the number of edges possible

m

Number of edges in the network

Details

Creates a random two-mode network. Will construct an affiliation matrix, with a certain probability of a tie.

See Also

Other creation: create

Examples

Run this code
# NOT RUN {
sample_affiliation(c(10, 12), 0.25) %>% ggraph::ggraph() +
ggraph::geom_edge_fan(ggplot2::aes(alpha = stat(index)), show.legend = FALSE) +
ggraph::geom_node_point(ggplot2::aes(size = 5))
# }

Run the code above in your browser using DataLab