st_round | R Documentation |
Rounding of geometry coordinates
st_round(x, digits = 0)
x |
An object of class |
digits |
Integer indicating the number of decimal places to be used. |
An object of class sf
or sfc
with rounded coordinates.
round
library(sf, quietly = TRUE)
p1 = st_sfc(st_point(c(1.123, 1.123)))
p2 = st_sfc(st_point(c(0.789, 0.789)))
p3 = st_sfc(st_point(c(1.123, 0.789)))
st_round(st_as_sf(c(p1, p2, p2, p3, p1)), digits = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.