Learn R Programming

starsExtra (version 0.2.8)

w_azimuth: Create matrix with azimuths to center

Description

Creates a matrix with directions (i.e., azimuth) to central cell, of specified size k. The matrix can be used as weight matrix when calculating the convergence index (see Examples).

Usage

w_azimuth(k)

Value

A matrix where each cell value is the azimuth from that cell towards the matrix center.

Arguments

k

Neighborhood size around focal cell. Must be an odd number. For example, k=3 implies a 3*3 neighborhood.

Examples

Run this code
m = w_azimuth(3)
m
m = w_azimuth(5)
m

Run the code above in your browser using DataLab