extractRaster | R Documentation |
This function extracts the information contained in raster tiles into the basemap. It operates a one-to-one matching using the tiles names. If unnamed, the workflow is slower and could leave out a small number of polygons.
extractRaster(sf, rast, fun, tile = NULL, newcol)
sf |
One sf object, i.e. a basemap tile |
rast |
A list of raster tiles, ideally named to match mastermap tiles (as obtained through makeTiles()) |
fun |
The function to be applied in zonal stats. Either "mean" for numeric values, or "majority" for the most common occurrence. |
tile |
The OS tile grid reference to match raster to mastermap tile; can be set dynamically with mapply |
newcol |
The name of the new attribute with extracted values |
An updated mm object with a new column containing the extracted values
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.