sample_grg | R Documentation |

Generate a random graph based on the distance of random point on a unit square

```
sample_grg(nodes, radius, torus = FALSE, coords = FALSE)
grg(...)
```

`nodes` |
The number of vertices in the graph. |

`radius` |
The radius within which the vertices will be connected by an edge. |

`torus` |
Logical constant, whether to use a torus instead of a square. |

`coords` |
Logical scalar, whether to add the positions of the vertices
as vertex attributes called ‘ |

`...` |
Passed to |

First a number of points are dropped on a unit square, these points
correspond to the vertices of the graph to create. Two points will be
connected with an undirected edge if they are closer to each other in
Euclidean norm than a given radius. If the `torus`

argument is
`TRUE`

then a unit area torus is used instead of a square.

A graph object. If `coords`

is `TRUE`

then with vertex
attributes ‘`x`

’ and ‘`y`

’.

Gabor Csardi csardi.gabor@gmail.com, first version was written by Keith Briggs (http://keithbriggs.info/).

`sample_gnp()`

Random graph models (games)
`erdos.renyi.game()`

,
`sample_bipartite()`

,
`sample_correlated_gnp_pair()`

,
`sample_correlated_gnp()`

,
`sample_degseq()`

,
`sample_dot_product()`

,
`sample_fitness_pl()`

,
`sample_fitness()`

,
`sample_forestfire()`

,
`sample_gnm()`

,
`sample_gnp()`

,
`sample_growing()`

,
`sample_hierarchical_sbm()`

,
`sample_islands()`

,
`sample_k_regular()`

,
`sample_last_cit()`

,
`sample_pa_age()`

,
`sample_pa()`

,
`sample_pref()`

,
`sample_sbm()`

,
`sample_smallworld()`

,
`sample_traits_callaway()`

,
`sample_tree()`

,
`sample_()`

Random graph models (games)
`erdos.renyi.game()`

,
`sample_bipartite()`

,
`sample_correlated_gnp_pair()`

,
`sample_correlated_gnp()`

,
`sample_degseq()`

,
`sample_dot_product()`

,
`sample_fitness_pl()`

,
`sample_fitness()`

,
`sample_forestfire()`

,
`sample_gnm()`

,
`sample_gnp()`

,
`sample_growing()`

,
`sample_hierarchical_sbm()`

,
`sample_islands()`

,
`sample_k_regular()`

,
`sample_last_cit()`

,
`sample_pa_age()`

,
`sample_pa()`

,
`sample_pref()`

,
`sample_sbm()`

,
`sample_smallworld()`

,
`sample_traits_callaway()`

,
`sample_tree()`

,
`sample_()`

```
g <- sample_grg(1000, 0.05, torus = FALSE)
g2 <- sample_grg(1000, 0.05, torus = TRUE)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.