# Construct circle with increasing accuracy and of different spatial classes
disc1 <- discpoly(c(0,0), 5, npoly=4, class = "owin")
disc2 <- discpoly(c(0,0), 5, npoly=16, class = "Polygon")
library("spatstat")
print(disc1)
plot(disc1, axes=TRUE, main="", border=2)
print(disc2)
lines(disc2, col=3)
if (require("gpclib")) {
oopt <- surveillance.options(gpclib=TRUE)
disc3 <- discpoly(c(0,0), 5, npoly=64, class = "gpc.poly")
print(disc3)
plot(disc3, add=TRUE, poly.args=list(border=4))
surveillance.options(oopt)
}
# if one only wants to draw a circle without an object behind
symbols(0, 0, circles=5, inches=FALSE, add=TRUE, fg=5)
Run the code above in your browser using DataLab