Skip to content
Back to formatted view

Raw Message

Message-ID: <CAD0a9Ki0WBK4C9-PVVYM35jS_3rDZSAL6PiiMHZX1YLRZZanJg@mail.gmail.com>
Date: 2018-08-27T20:53:01Z
From: Ariel Fuentesdi
Subject: Spatial Query (Selection) with Apply

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 at 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]]