osc.buffer: Simple Buffer algorithm

Description Usage Arguments Value Examples

View source: R/code_revised_cca.R

Description

Simple buffer based on euclidean distance are created around all cells equal to one.

Usage

1
osc.buffer(input, width=max(dim(input)), return.width=F, complete=F) 

Arguments

input

Matrix or Raster containing 1 indicating a cluster, no NA values are allowed

width

Width of the buffer in cells

return.width

Logical value, if TRUE then the distance to the nearest cell with value 1 will be returned for all cells within the buffer.

complete

Logical value, if TRUE the buffer will be increased until the whole raster is covered. Can only be used in combination with return.width=TRUE.

Value

Returns matrix or raster, depending on input, with 1 for cluster and -1 for surrounding buffer. If return.width=TRUE negative numbers indicating the distance (width) to the nearest cell with value 1.

Examples

1
2
3
4
5
6
7
8
data(landcover)
landcover[landcover[]>1] <- 0

plot(osc.buffer(landcover, 6))

plot(osc.buffer(landcover, 6, return.width = TRUE))

plot(osc.buffer(landcover, return.width = TRUE, complete = TRUE))

SteffenKriewald/osc documentation built on Dec. 24, 2019, 7:06 p.m.