Learn R Programming

SpatialKDE (version 0.8.2)

create_raster: Create raster

Description

Create raster of equally spaced cells. The distance between centre of cells in both x and y dimension is equal to cell_size.

Usage

create_raster(geometry, cell_size, side_offset = 0)

Value

Raster-class

Arguments

geometry

sf data.frame containing geometry which should be cover by the raster.

cell_size

numeric specifying the distance for equally spaced cells.

side_offset

numeric specifying the side offset, distance added to the convex hull of input geometry to generate raster for KDE. Good estimate is usually the same value as band width of KDE.

Examples

Run this code
library(sf)
nc <- st_read(system.file("shape/nc.shp", package = "sf")) %>% st_transform(32031)
raster <- create_raster(nc, cell_size = 100000)

Run the code above in your browser using DataLab