View source: R/distanceToCoast.R
distanceToCoast | R Documentation |
Create a raster layer with the distance to coast for the sea or land (if inverse=TRUE).
distanceToCoast(ncol, nrow, extent='', inverse=FALSE, ...)
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 |
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.
A Raster* layer
distSea <- distanceToCoast(ncol=36, nrow=18) distLand <- distanceToCoast(ncol=36, nrow=18, inverse=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.