an sf object or a SpatialPolygonsDataFrame including var1 and var2.
xid
identifier field in x (to be used for importing a personal distance
matrix). Default to the first column.
var1
name of the numerator variable in x.
var2
name of the denominator variable in x.
ref
ratio of reference; if missing, the ratio of reference is the one of
the whole study area (sum(var1) / sum(var2)).
key
aggregation key field for measuring the deviation (intermediate territorial level).
order
contiguity order.
dist
distance threshold defining the contiguity. The cartesian
distance between units centroids is used by default
(see st_distance); use mat to apply different metrics.
mat
a distance matrix (road distance, travel time...) between x units.
Row and column names must fit xid identifiers. (optional)
Value
A dataframe including the mass of numerator to redistribue to reach a perfect equilibrium
according to the 3 contexts, expressed in numerator measure unit and as a share of the numerator mass.