R tricks >

Generate a global rectangular grid with sf

library(ggplot2)
library(sf)

geom <- st_sfc(st_polygon(list(rbind(c(-180, -90), c(180, -90), c(180, 90), c(-180, 90), c(-180, -90)))), crs = 4326)
grid <- st_make_grid(geom, cellsize = 2, square = TRUE)

ggplot() + 
  geom_sf(data = grid) +
  coord_sf(crs = st_crs(54030)) +
  theme_void()

global grid