## Make polygon
poly_sf <- c(xmin = -74.02426,
xmax = -73.91048,
ymin = 40.70042,
ymax = 40.87858) |>
sf::st_bbox() |>
sf::st_as_sfc() |>
sf::st_as_sf()
sf::st_crs(poly_sf) <- 4326
## Make grid using polygon
grid_sf <- gt_make_grid(polygon = poly_sf,
height = 2000,
width = 2000,
zoom = 16)
Run the code above in your browser using DataLab