Learn R Programming

migest (version 2.0.4)

sum_net: Calculate net migration from an origin-destination migration flow matrix.

Description

Sums each regions flows to obtain net migration sums.

Usage

sum_net(m, region = 1:dim(m)[1])

Value

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

Arguments

m

Matrix of origin-destination flows, where the first and second dimensions correspond to origin and destination respectively.

region

Integer value corresponding to the region that the net migration sum is desired. Will return sums for all regions by default.

Author

Guy J. Abel

Examples

Run this code
r <- LETTERS[1:4]
m <- matrix(data = 1:16, nrow = 4, ncol = 4,
            dimnames = list(orig = r, dest = r))
m
sum_net(m)

Run the code above in your browser using DataLab