distanceToCoast: Calculate distance to coast

View source: R/distanceToCoast.R

distanceToCoastR Documentation

Calculate distance to coast

Description

Create a raster layer with the distance to coast for the sea or land (if inverse=TRUE).

Usage

distanceToCoast(ncol, nrow, extent='', inverse=FALSE, ...)

Arguments

ncol

Number of columns used for creating distanceToCoast raster

nrow

Number of rows used for creating distanceToCoast raster

extent

Extent used for creating distanceToCoast raster

inverse

Logical. If TRUE the distance to land will be calculated

...

Additional required (!) parameters. These are data set specific. See Details

Details

distanceToCoast internally loads the outline data, which is also included in this package. It then creates a raster of the outline shapefile using the rasterize function according to the specified resolution and extent provided and then calculates the distance using the distance function from the raster package.

Value

A Raster* layer

References

http://www.gadm.org

Examples

distSea <- distanceToCoast(ncol=36, nrow=18)
distLand <- distanceToCoast(ncol=36, nrow=18, inverse=TRUE)


RS-eco/ggmap2 documentation built on Dec. 7, 2022, 2:02 a.m.