Skip to contents

Constructs a 2D grid of a given number of rows and columns over an sf object.

Usage

make_grid(sf_file, n_row, n_col)

Arguments

sf_file

sf object to pass grid over.

n_row

number of rows in grid.

n_col

number of columns in grid.

Value

An sf object with variables identifying col and row IDs (bottom left origin), geographic centroid of grid square.

Examples

library(gridmappr)
library(sf)
#> Linking to GEOS 3.10.2, GDAL 3.4.1, PROJ 8.2.1; sf_use_s2() is TRUE
grid <- make_grid(london_boroughs, 8, 8)