I have a list of coordinates (lat, lon) and would like to create a grid of squares where each of these coordinates is in the center of the square using R, and preferably SF (as I am used to it), but also open for other suggestions.
I basically trying to construct a grid of squares (that touches each other) around the points in the attached map.
This is first 5 obs of my data (the entire dataset spread across all Africa - like in the attached picture in the link):
Bounding box: xmin: 18.25 ymin: -34.75 xmax: 20.25 ymax: -34.25
Geodetic CRS: WGS 84
cell geometry
1 1 POINT (19.75 -34.75)
15 2 POINT (20.25 -34.75)
29 3 POINT (18.25 -34.25)
43 4 POINT (18.75 -34.25)
57 5 POINT (19.25 -34.25)
71 6 POINT (19.75 -34.25)
and would like to make a grid style st_make_grid(cellsize = XXX, what = "polygons") where the geometris points above are in the center of each polygon.