generate_grid: Create a regular grid using spdep package

Description Usage Arguments Value See Also

View source: R/gen_data_utils.R

Description

Create a regular grid with a certain number of locations, returning each location's position and neighbour matrices of order 0 and 1.

Usage

1
2
generate_grid(Nsites, grid.h = ceiling(sqrt(Nsites)),
  grid.w = ceiling(sqrt(Nsites)))

Arguments

Nsites

Number of locations in the grid

grid.h

Height of the grid (in number of locations). Defaults to sqrt(Nsites)

grid.w

Width of the grid (in number of locations). Defaults to sqrt(Nsites)

Value

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.

See Also

dnearneigh, nblag, nb2mat


mrfoliveira/Evaluation-procedures-for-forecasting-with-spatio-temporal-data documentation built on April 11, 2021, 10:50 a.m.