# NOT RUN {
local(envir=.PBSmapEnv,expr={
#--- create a PolySet with an extra column
polys <- data.frame(PID = c(rep(1, 10), rep(2, 10)),
POS = c(1:10, 1:10),
X = c(rep(1, 10), rep(1, 10)),
Y = c(rep(1, 10), rep(1, 10)),
colour = (c(rep("green", 10), rep("red", 10))))
#--- extract the PolyData
print(extractPolyData(polys))
})
# }
Run the code above in your browser using DataCamp Workspace