Learn R Programming

gridOT (version 1.0.2)

north_west_corner: North-west-corner Rule

Description

Calculate the transport plan obtained by the north-west-corner rule.

Usage

north_west_corner(wx, wy, threshold = 1e-15)

Value

a matrix representing the transport plan obtained by the north-west-corner rule.

Arguments

wx

first weight vector.

wy

second weight vector.

threshold

small value that indicates when a value is considered to be zero.

Examples

Run this code
set.seed(1)
wx <- rep(1/5, 5)
wy <- runif(6)
wy <- wy / sum(wy)
north_west_corner(wx, wy)

Run the code above in your browser using DataLab