powered by
rotates polygon by specified angle
rotate.polygon( p, angle = 45, sp = FALSE, anchor = c("center", "lower.left", "upper.right") )
an sp or sf polygon object with rotated polygon
A polygon object of sf or sp class
Rotation angle in degrees
(FALSE | TRUE) Output sp class object
Location to rotate polygon on options are "center", "lower.left" and "upper.right"
library(sp) library(rgeos) data(meuse) coordinates(meuse) <- ~x+y e <- gConvexHull(meuse) e30 <- rotate.polygon(e, angle=30, sp=TRUE) plot(e, main="rotated 30 degrees") plot(e30, add=TRUE)
Run the code above in your browser using DataLab