Description Usage Arguments Value See Also
View source: R/gen_data_utils.R
Create a regular grid with a certain number of locations, returning each location's position and neighbour matrices of order 0 and 1.
1 2 | generate_grid(Nsites, grid.h = ceiling(sqrt(Nsites)),
grid.w = ceiling(sqrt(Nsites)))
|
Nsites |
Number of locations in the grid |
grid.h |
Height of the grid (in number of locations).
Defaults to |
grid.w |
Width of the grid (in number of locations).
Defaults to |
A list with slots sites – a data frame with
columns id, x and y –, and klist – a list of neighbour
matrices of order 0 and 1 where the values are calculated
using functions from spdep
package.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.