**Initial problem:**
I am currently trying to create a spatial grid in which each cell is centered on predefined spatial points. These spatial points are projected in the WGS84 international coordinate system.

I am starting with a long/lat dataframe containing around 8000 point-location over France ([data available here][1]).

    df=read.table("~/centroids.csv",sep=",",header=T)
    plot(df$longitude,df$latitude,pch=".")
[![centroidsPlotFrance][2]][2]

I want to compute "tile" polygons that will fill the entire space around these points. Something like in [this post][3], with each point of *df* at the center of tiles, such as :

[![exampleTileCenteredOnPoints][4]][4]

I tried several methods from the sf and raster package such as : st_make_grid(), rasterFromXYZ() combined with rasterToPolygons() that I saw in [this post][5], or even the basic raster() using gridded() that I saw on [this post][6]. I also tried to use gBuffer() such as in [this post][7]. But without any sucess... I am always fighting against projection or non-regular/planar coordinates errors !

Once I will be able compute those tiles (or polygons), I want to store them in a simple feature object (from the sf package). Within this sf object: each polygon will correspond to a cell of the final spatial grid; each polygon will be centered on a spatial point from *df*; and each polygon will inherit the ID of the point (from *df*) on which it is centered.

Is that possible ???

  [1]: https://github.com/mgarnault/Help
  [2]: https://i.sstatic.net/SXkdg.png
  [3]: https://gis.stackexchange.com/questions/273233/create-spatial-polygon-grid-from-spatial-points-in-r
  [4]: https://i.sstatic.net/tOhpn.png
  [5]: https://gis.stackexchange.com/questions/298972/converting-lat-long-and-values-to-raster-doesnt-project-correctly
  [6]: https://gis.stackexchange.com/questions/20018/how-can-i-convert-data-in-the-form-of-lat-lon-value-into-a-raster-file-using-r/20052
  [7]: https://gis.stackexchange.com/questions/220358/real-dimensions-of-square-buffers