Learn R Programming

marmap (version 0.9.4)

outline.buffer: Get a buffer in a proper format to allow the plotting of its outline

Description

Get a buffer in a format suitable for plotting its outline. outline.buffer replaces any NA values in buffer by 0 and non NA values by -1.

Usage

outline.buffer(buffer)

Arguments

buffer
a buffer object of class bathy (i.e. bathy matrix containing depth/altitude values within the buffer and NAs outside)

Value

  • An object of class bathy of the same dimension as buffer containing only zeros (outside the buffer area) and -1 values (within the buffer).

Details

This function is essentially used to prepare a buffer or a combination of buffers for plotting its outline on a bathymetric map.

See Also

create.buffer, combine.buffers, plot.bathy

Examples

Run this code
# load and plot a bathymetry
data(florida)
plot(florida, lwd = 0.2)
plot(florida, n = 0, lwd = 0.7, add = TRUE)

# add points around which a buffer will be computed
loc <- data.frame(c(-80,-82), c(26,24))
points(loc, pch = 19, col = "red")

# compute buffer
buf <- create.buffer(florida, loc, radius=1.5)

# plot buffer outline
plot(outline.buffer(buf), add=TRUE, lwd=.7, col=2)

Run the code above in your browser using DataLab