plot_mst {MTA} | R Documentation |
Plot Multiscalar Typology (3 deviations)
Description
Vizualizing mst for selected territorial units.
Usage
plot_mst(
x,
gdevrel,
tdevrel,
sdevrel,
legend.lab = NULL,
lib.var,
lib.val,
cex.lab = 1,
cex.axis = 0.8,
cex.names = 0.8
)
Arguments
x |
a sf object or a dataframe including 3 pre-calculated deviations. |
gdevrel |
name of the general relative deviation variable in x. |
tdevrel |
name of the territorial relative deviation variable in x. |
sdevrel |
name of the the spatial relative deviation variable in x. |
legend.lab |
label for explaining the plot (default = "G: general, T: territorial, S: spatial (relative deviations, average = 100)". |
lib.var |
column name of x including territorial units name/code we want to display on the plot. |
lib.val |
a vector of territorial units included in lib.label we want to display on the plot. |
cex.lab |
size of the axis legend label text (default = 1). |
cex.axis |
size of the tick label numbers (default = 0.8). |
cex.names |
size of the territorial units labels if selected (default 0.8). |
Value
A barplot displaying the position for selected territorial units on three territorial deviation. Y axis is expressed in logarithm (25 being index 80).
Examples
# Load data
library(sf)
com <- st_read(system.file("metroparis.gpkg", package = "MTA"), layer = "com", quiet = TRUE)
# Prerequisite - Compute the 3 relative deviations
com$gdev <- gdev(x = com, var1 = "INC", var2 = "TH")
com$tdev <- tdev(x = com, var1 = "INC", var2 = "TH", key = "EPT")
com$sdev <- sdev(x = com, var1 = "INC", var2 = "TH", order = 1)
# Synthesis barplot (3 territorial units)
plot_mst(x = com, gdevrel = "gdev", tdevrel = "tdev", sdevrel = "sdev", lib.var = "LIBCOM",
lib.val = c("Neuilly-sur-Seine", "Clichy-sous-Bois", "Les Lilas"))