Skip to content
Prev 25709 / 29559 Next

Deal with multiple factorlevel in one grid square

Hiya,

Do you want a raster with attribute information (ie several attributes from your  shape file)? You can achieve this with a workflow that uses 
raster::extract() to assigne unique IDs of polygon to raster cells
create a RAT for you raster
assign to the unique IDs of raster RAT the attributes of your polygon unique IDs (many to one relationship) with something like merge() or functions in libraries like diplyr or data.table

Cheers
Herry

-----Original Message-----
From: R-sig-Geo [mailto:r-sig-geo-bounces at r-project.org] On Behalf Of Patrick Schratz
Sent: Wednesday, 24 May 2017 10:48 PM
To: Michael Sumner <mdsumner at gmail.com>; Miriam P?ts <miriam.puets at thuenen.de>
Cc: r-sig-geo at r-project.org
Subject: Re: [R-sig-Geo] Deal with multiple factorlevel in one grid square

Do you want to do what is called ?zonal statistics? in ArcGIS with ?majority" option?

You may check out this SO question and try the ?mode? function within raster::extract() - maybe it does what you need.

(I?m also unsure if I understand the question correctly)

Cheers, Pat

PhD Student at Department of Geography - GIScience group Friedrich-Schiller-University Jena, Germany
Tel.: +49-3641-9-48973
Web: https://pat-s.github.io
On 24. May 2017, 12:35 +0200, Miriam P?ts <miriam.puets at thuenen.de>, wrote:
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo