mas | R Documentation |
This function sums the total amount of redistributions according to the three absolute deviations (global, territorial, spatial).
mas(x, gdevabs, tdevabs, sdevabs, num)
x |
a sf object or a dataframe including gdevabs, tdevabs, sdevabs and num columns. |
gdevabs |
name of the general absolute deviation variable in x. |
tdevabs |
name of the territorial absolute deviation variable in x. |
sdevabs |
name of the spatial absolute deviation variable in x. |
num |
name of the numerator used for computing the 3 absolute deviations in x. |
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.
# Load data
library(sf)
com <- st_read(system.file("metroparis.gpkg", package = "MTA"), layer = "com", quiet = TRUE)
# general absolute deviation
com$gdevabs <- gdev(x = com, var1 = "INC",var2 = "TH", type = "abs")
# Territorial absolute deviation calculation
com$mdevabs <- tdev(x = com, var1 = "INC", var2 = "TH", type = "abs",
key = "LIBEPT")
# Local absolute deviation calculation redistribution
com$ldevabs <- sdev(x = com, xid = "DEPCOM", var1 = "INC", var2 = "TH",
order = 1, type = "abs")
# Compute the synthesis DataFrame (absolute deviations)
mas(x = com,
gdevabs = "gdevabs",
tdevabs = "mdevabs",
sdevabs = "ldevabs",
num = "INC")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.