#create raster for resolution and extent
ras <- terra::rast(terra::ext(-5,5,-4,4), res = 1)
#create point gazeteer
pts <- data.frame(long = runif(n = 5, min = -5, max = 5),
lat = runif(n = 5, min = -4, max = 4),
dat = rep("A", 5))
pts <- terra::vect(pts, geom = c("long", "lat"))
lin <- as.matrix(data.frame(long = seq(-5, 5, by = 1),
lat = rep(2, times = 11)))
lin <- terra::vect(lin, type = "line")
gaz <- list(point.structure = pts, lines.strucutre = lin)
out <- dis_rast(gaz, ras)
Run the code above in your browser using DataLab