coords_to_raster: Create a raster from coordinates

View source: R/coords_to_raster.R

coords_to_rasterR Documentation

Create a raster from coordinates

Description

Generate a raster layer from coordinates which can be used in window_gd as the RasterLayer to move the window across

Usage

coords_to_raster(
  coords,
  buffer = 0,
  res = 1,
  agg = NULL,
  disagg = NULL,
  plot = FALSE
)

Arguments

coords

coordinates of samples as sf points, a SpatVector, a two-column matrix, or a data.frame with x and y coordinates

buffer

size of buffer to add to edge of raster (defaults to 0)

res

desired resolution of raster (defaults to 1). Can be a single value for square cells or a vector with two values representing x and y resolutions

agg

aggregation factor to apply to raster (defaults to NULL)

disagg

disaggregation factor to apply to raster (defaults to NULL)

plot

whether to plot resulting raster with coords (defaults to FALSE)

Value

RasterLayer

Examples

load_mini_ex()
coords_to_raster(mini_coords, buffer = 1, plot = TRUE)

wingen documentation built on May 29, 2024, 9:59 a.m.