[R-sig-Geo] Heat mapping within shape file

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Mon Mar 30 13:00:41 CEST 2015


On Sun, Mar 29, 2015 at 11:50 AM, Leask, Graham <g.leask at aston.ac.uk> wrote:
> What is a straightforward way to produce a heat map with the heat map strictly constrained within but filling shape file borders?

 If your heat map is a raster then there's functions in the raster
package to mask rasters to polygons.

> If someone can illustrate an example in R I would be most grateful.

 Where are you starting from? Do you know how to read shapefiles into R?

This question on gis.stackexchange.com might help. It uses "mask" from
the raster package to crop a raster:

http://gis.stackexchange.com/questions/61243/clipping-a-raster-in-r

Barry (aka spacedman on gis.stackexchange.com...)



More information about the R-sig-Geo mailing list