Description Usage Arguments Details Value See Also Examples
Function for the simulation framework in GAIL. Create a set of spatial polygon regions. For a more comprehensive description of how to use the simulation framework, see the vignette "GAIL Simulation."
1 2 | gail_sim_regions(npoints, type = "irregular", nedge = 5, seed = NULL,
suid = NULL, ...)
|
npoints |
Number of internal points to select |
type |
Type of spatial units to generate, accepts "regular" and "irregular". See details. |
nedge |
Data frame containing the the cases, see details. |
seed |
If given, sets the seed for the RNG. |
suid |
Optional spatial unit ID, used as prefix for generated spatial units. |
... |
Space for additional arguments (e.g., for |
The type
argument works as follows:
type="regular"
produces a regular grid of units with nedge
units along each dimension.
type="irregular"
randomly draws 1000 points uniformly across a 100x100 region (excluding a band of
width 5 around the edge). Then uses fields::cover.design
to select npoints
of them.
Creates regions using Voronoi tesselation via deldir::deldir
and deldir::tile.list
.
Returns an object of class sf
with POLYGON geometry. This represents a set of areal
gail_sim_rate, gail_sim_pop, gail_sim_index, gail_sim_assign
1 2 3 4 5 6 7 8 9 10 | ## Not run:
loca_reg <- gail_gen_regions( npoints=40, type="regular" , nedge=10, suid="reg" )
loca_irr <- gail_gen_regions( npoints=40, type="irregular", nedge=6 , seed=42 , P=-20, Q=20 )
ggplot( loca_reg ) +
geom_sf( aes(fill=region) )
ggplot( loca_irr ) +
geom_sf( aes(fill=region) )
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.