inlabru-org / fmesher

Standalone package for mesh/SPDE/GMRF code from the INLA package
https://inlabru-org.github.io/fmesher/
Mozilla Public License 2.0
11 stars 1 forks source link

Function `fm_unify_coords.sf` duplicated #13

Closed PPaccioretti closed 3 months ago

PPaccioretti commented 3 months ago

The fm_unify_coords.sf function is duplicated here. The second definition raises an error when an sf object is used.

library(inlabru)
#> Loading required package: fmesher
data("gorillas_sf")

fm_mesh_2d_inla(loc = gorillas_sf$nests,
                max.edge = 40)
#> Error in sf::st_sfc(x): use st_as_sfc() to extract geometries from an sf object

Created on 2024-03-27 with reprex v2.1.0

finnlindgren commented 3 months ago

Thanks for finding that! The first of the duplicates was the correct one, with sf::st_geometry(), that sf:::st_as_sfc.sf() calls internally.

finnlindgren commented 3 months ago

Now fixed in 0.1.5.9001