athowes / beyond-borders

Evaluating the suitability of spatial adjacency for small-area estimation
https://athowes.github.io/beyond-borders
MIT License
2 stars 1 forks source link

Need to project before using hexagonal sampling in `cv_fik-inla` #36

Closed athowes closed 7 months ago

athowes commented 2 years ago
[1] "Begin LOO cross-valdiation of CIV2017PHIA"
[ failed     ]  2022-02-20 11:00:05
[ elapsed    ]  Failed report in 0.2224343 secs
Error in st_poly_sample(x, size = size, ..., type = type, by_polygon = by_polygon) : 
  hexagonal sampling on geographic coordinates not supported; consider projecting first
In addition: Warning message:
 Error in st_poly_sample(x, size = size, ..., type = type, by_polygon = by_polygon) : 
  hexagonal sampling on geographic coordinates not supported; consider projecting first 
athowes commented 2 years ago

https://geocompr.robinlovelace.net/reproj-geo-data.html

athowes commented 2 years ago

Want to use st_transform but don't know the right arguments to set.

athowes commented 2 years ago

Tried using st_transform(3857) which is "Projected CRS: WGS 84 / Pseudo-Mercator". Then I run into the same problem as with the inla_ck!

 Error in Ops.units(m, 1e-08) : 
  both operands of the expression should be "units" objects 
athowes commented 2 years ago

Jeff suggests EPSG:4326.