# rectangle
u <- unit.square()
border(u, 0.1)
border(u, 0.1, outside=TRUE)
# polygon
data(letterR)
plot(letterR)
plot(border(letterR, 0.1), add=TRUE)
plot(border(letterR, 0.1, outside=TRUE), add=TRUE)
Run the code above in your browser using DataLab