Learn R Programming

WSGeometry (version 1.2.1)

smear: Split the values of entries in a matrix between a specified area round it.

Description

Takes a matrix M and splits the value of the matrix at a given coordinate (i,j) with a rectangle of positions around it given by r1 and r2. The position (i,j) will get its previous value divided by (r1 x r2) and the surrounding positions (r1 in horizontal and r2 in vertical direction) will have their entries increased by the same value.

Usage

smear(M, r1, r2)

Arguments

M

A matrix with real numbers as entries.

r1

Integer specifying the range of the split in the horizontal direction.

r2

Integer specifying the range of the split in the vertical direction.

Value

A matrix of the same dimensions as M, which had the mass split applied to all entries simultaneously.