Learn R Programming

mmand (version 1.6.3)

neighbourhood: Get neighbourhood information for an array

Description

This function provides information about the structure of a neighbourhood of a given width within a specified array.

Usage

neighbourhood(x, width)

Value

A list with the following elements.

widths

The width of the neighbourhood along each dimension. Currently all elements of this vector will be the same.

size

The number of pixels within the neighbourhood.

locs

A matrix giving the coordinates of each neighbourhood pixel relative to the centre pixel, one per row.

offsets

Vector offsets of the neighbourhood values within x.

Arguments

x

An object that can be coerced to an array.

width

A vector giving the width of the neighbourhood in each dimension, which will be recycled if necessary. Must not be greater than the size of the array. Even values are rounded up to the next odd integer.

Author

Jon Clayden <code@clayden.org>