# \donttest{
# Create data frame of boundary points (anti clockwise!)
pts <- data.frame(
x = c(1, 2, 1.7, 1.3),
y = c(1, 1, 2, 2)
)
# Convert to SpatialPolygonsDataFrame
pol <- spoly(pts)
if (require(ggplot2, quietly = TRUE)) {
# Plot it!
ggplot() +
gg(pol)
}
# }
Run the code above in your browser using DataLab