View source: R/randomizeClusters.R
sampleGridPop | R Documentation |
This function samples locations from a grid, and separately samples NetworkIDs, which are then assigned to those locations.
sampleGridPop(grid, n.networks, NetworkIDs, seed)
grid |
A dataframe of x and y coordinates (can be created with |
n.networks |
The number of networks to be placed in the realization. |
NetworkIDs |
Vector of NetworkIDs to randomly assign to the grid. |
seed |
A number to set random seeds, if a goal is the ability to reproduce the random sampling. |
library(magrittr) library(dplyr) grid = createPop(0, 25, 0, 25) n.networks = 2 data(Thompson1990Fig1Pop) NetworkIDs = Thompson1990Fig1Pop %>% filter(m > 1) %$% unique(NetworkID) seed = 1 sampleGridPop(grid, n.networks, NetworkIDs, seed)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.