Learn R Programming

migest (version 1.7.3)

block.sum: Sum of a Block Within a Matrix

Description

Returns of a sum of a block within a matrix. This function is predominantly intended to be used within the ipf2.b routine.

Usage

block.sum(block = NULL, m = NULL, bid = NULL)

Arguments

block
The block to summed. To be matched against the matrix in bid.
m
The complete matrix of values.
bid
A matrix of the same dimensions of m used to identify blocks.

Value

Matrix of values, where x is repeated in each block.

Details

Returns a numeric value of the sum of a single block.

See Also

ipf2.b

Examples

Run this code
m <- matrix(100:220, nrow = 11, ncol = 11)
b <- block.matrix(1:16, c(2,3,4,2))
block.sum(1, m, b)
block.sum(4, m, b)
block.sum(16, m, b)

Run the code above in your browser using DataLab