[R-sig-Geo] Request for help on R codes for equivalent QGIS operation

Bhaskar Mitra bh@@k@r@ko|k@t@ @end|ng |rom gm@||@com
Fri Feb 25 16:23:09 CET 2022


Hello Everyone,

I have two shapefiles :

shp1 has 400 polygons. One of the columns is X.
shp2 has 10 polygons.

Both have the same extent and crs. I want to summarize the value of column
X from shp1 within the
boundary of each polygons for shp2

Can anyone please suggest to me an equivalent approach in R to join
attributes by location.

I am using the following approach in QGIS:

1) Under Processing Toolbox, select Vector General
2) Join attributes by location (summary)
3) Select shp2 as Input Layer
4) Select shp1 as Join layer
5) Under Geometric properties, select intersects, overlaps,
contains and within
4) Fields to summarizse: select X
5) Summaries to calculate: select sum


I would really appreciate some help or suggestions in this regard.

Thanks,
Bhaskar

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list