I am new to R, and I am trying to use it to calculate the areas of polygons that overlap with each gridcell, in order to assign the attributes of the largest overlapping polygon area to the corresponding cell and build a dataframe, in which each gridcell represents a row, and attributes represent columns.
As shown in the figure above, I have a polygon shapefile representing indegenous lands and an overlayed gridcell (polygons).
Is there anyway I could do this? I have seen this question/answer: How to measure the area of polygons within a fishnet but for some reason the intersect function in QGIS (which is the GIS software I am using) does not generate a new layer.
Just in case, here you could download my spatial data: https://www.dropbox.com/sh/hdbpcq80uzd1ben/AADdG5Lg-BBbvFwA3QRLycSRa?dl=0