maskByCountry: Function to mask out cells outwith polygons defining a...

View source: R/spCEH.R

maskByCountryR Documentation

Function to mask out cells outwith polygons defining a country within the UK

Description

Function to mask out cells outwith polygons defining a country within the UK

Usage

maskByCountry(r, countryName)

Arguments

r

A RasterLayer.

countryName

The name of a country within the UK ("Scotland", "Northern Ireland", "England" or "Wales").

Value

A RasterLayer masked to the named country.

Examples

r <- getSpatRasterTemplate(domain = "UK", res = 10000, proj = 'OSGB')
r[] <- 1
r_masked <- maskByCountry(r, c("England", "Wales"))
plot(r_masked)

NERC-CEH/spCEH documentation built on June 12, 2024, 2:45 p.m.