powered by
This will extract using terra::crds, sf::st_coordinates and raster::coordinates. Other packages can create methods, as this is generic.
terra::crds
sf::st_coordinates
raster::coordinates
# S4 method for ANY coordinates(obj, ...)
A 2 column matrix of coordinates (x and y)
An object from which to extract the coordinates (e.g., sf, sp)
sf
sp
Ignored.
library(terra) caribou <- terra::vect(x = cbind(x = stats::runif(1e1, -50, 50), y = stats::runif(1e1, -50, 50))) coordinates(caribou)
Run the code above in your browser using DataLab