sampleGridPop: Assign a sample of cluster centers (derived from real data)...

View source: R/randomizeClusters.R

sampleGridPopR Documentation

Assign a sample of cluster centers (derived from real data) to a sample of grid locations

Description

This function samples locations from a grid, and separately samples NetworkIDs, which are then assigned to those locations.

Usage

sampleGridPop(grid, n.networks, NetworkIDs, seed)

Arguments

grid

A dataframe of x and y coordinates (can be created with createPop).

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.

Examples

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)

ksauby/ACS documentation built on Aug. 18, 2022, 3:33 a.m.