Skip to content
Prev 26307 / 29559 Next

How to label a polygon window (spatstat package)

Maybe you meant something like this:


# example of several polygons (in a list)
x <- runif(20)
y <- runif(20)

polygons<- list()
for (i in 1:20) polygons[[i]]<- disc(radius=0.05, centre=c(x[i], y[i]))
plot(owin())
lapply(polygons, plot, add=T)

# label each polygon
labs<-letters
for (i in 1: length(polygons)) {xy<-centroid.owin(polygons[[i]]); 
text(xy$x,xy$y, labs[i])}



Cheers,

Marcelino



El 10/02/2018 a las 6:43, Mohammad Tanvir Ahamed via R-sig-Geo escribi?: