latmask: Latitude mask for polar raster

Description Usage Arguments Details Value See Also Examples

View source: R/latitude.R

Description

Mask out values based on latitude for a raster. This works by finding all cells at latitudes less than latitude and setting them to missing. If southern = FALSE the inequality is reversed, and all cells at latitudes greater than latitude are masked out.

Usage

1
latmask(x, latitude = 0, southern = TRUE, trim = FALSE, ...)

Arguments

x

a raster layer

latitude

maximum latitude (effectively a minimum latitude if southern = FALSe)

southern

flag for whether south-polar context is used, default is TRUE

trim

if TRUE runs raster::trim on the result, to remove NA margin

...

ignored currently

Details

The trim option allows for the result to be reduced to the common bounding box within which any row or column has a non-missing value.

Value

RasterLayer

See Also

raster::trim, latitudecircle

Examples

1
2
3
4
5
6
7
 
library(raster)
plot(latmask(ice, -60))
plot(latmask(ice, -60, trim = TRUE))
ice[!ice > 0] <- NA
plot(ice)
plot(latmask(ice, -55, trim = TRUE))

spex documentation built on July 2, 2020, 2:22 a.m.