[R-sig-Geo] Spatial Query (Selection) with Apply

Ariel Fuentesdi @riel@fuente@di @ending from u@@ch@cl
Mon Aug 27 22:53:01 CEST 2018


Hi,

I want to do multiple selections of a point shapefile based on polygons on
other layers, I can do this in a for loop, but I desire to do this in a
function of the apply family.

I named the point shapefile "nodes" and the polygons shapefile "zones".

This is what I did:

tmp <- list()
for (i in 1:nrow(zones using data)) {
    tmp[[i]] <- nodes[subset(zones, ESTUDIO == i),]
    tmp
  }

But I have no clue how to change it to the apply family, can you provide
an example of this?

Thanks in advance.

Regards,
Ariel Fuentes

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list