st_rotate | R Documentation |
Rotate a simple feature
st_rotate(x, r = pi/2, degrees = FALSE)
x |
sf object |
r |
numeric, radians (or degrees) to rotate. Must be of length 1 (in
which case the value is recycled) or length equal to the number of rows in |
degrees |
logical, if TRUE intepret |
a rotated version of the input x
https://r-spatial.github.io/sf/articles/sf3.html#affine-transformations-1
## Not run:
v <- volcano_multi(what = 'bands')
x <- volcano_polygon()
x2 <- st_rotate(x, -pi/8)
plot(v[,,,1], reset = FALSE)
plot(sf::st_geometry(x), add = TRUE, border = "purple", col = NA, lwd = 3)
plot(sf::st_geometry(x2), add = TRUE, border = "orange", col = NA, lwd = 3)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.