Learn R Programming

MTA (version 0.2.0)

mapmst: Map Multiscalar Typology

Description

Map the multiscalar typology according to the three relative deviations (general: G, territorial: T and spatial: S). The elementary units are classified in eight classes according to their three relative positions and they are mapped with appropriate colors.

Usage

mapmst(x, var1, var2, ref, key, order, dist, mat, xid, threshold,
  superior = FALSE, colNA = "white", border = "grey80", lwd = 0.2,
  upborder = "black", uplwd = "1", add = FALSE)

Arguments

x

an sf object or a SpatialPolygonsDataFrame including var1 and var2.

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 ; 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)

xid

identifier field in x (to be used for importing a personal distance matrix). Default to the first column.

threshold

defined to build the typology (100 is considered as the average).

superior

if TRUE, deviation values must be greater than threshold. If FALSE, deviation values must be lower than threshold.

colNA

no data color

border

color of the polygons border

lwd

borders width

upborder

color of the intermediate territorial level border

uplwd

intermediate territorial level border width

add

whether to add the layer to an existing plot (TRUE) or not (FALSE)

Value

A typology map with colours and a sf object including the ratio (var1/var2), the 3 relative deviations (G, T and S) and the resulting ordered typology (0 to 7).

  • 0: none

  • 1: G

  • 2: T

  • 3: G and T

  • 4: S

  • 5: G and S

  • 6: T and S

  • 7: G, T and S

Examples

Run this code
# NOT RUN {
library(sf)
library(cartography)
data("GrandParisMetropole")
# Map wealthiest territories
synthesis <- mapmst(x = com, var1 = "INC", var2 = "TH", key = "EPT",
                    order = 1,threshold = 125, superior = TRUE)
# add a layout and adapted legend
layoutLayer(title = "Multiscalar synthesis - Income per household 2013",
            sources = "GEOFLA<U+00AE> 2015 v2.1, Apur, impots.gouv.fr",
            north = TRUE, scale = 5, tabtitle = TRUE, frame = FALSE, theme = "red.pal",
            author = "MTA
100: Deviation average
G: Situation as compared to the global context (Grand Paris Area)
T: Situation as compared to the territorial context (EPT of belonging)
S: Situation as compared to the neigbourhood context (contiguity order 1)")
# add label territorial objects above 125% for all the deviations
labelLayer(x = synthesis[synthesis$mst == 7, ], txt = "LIBCOM", cex = 0.6, 
           halo = TRUE, overlap = FALSE)



# Map poorest territories 
synthesis <- mapmst(x = com, var1 = "INC", var2 = "TH", key = "EPT",
                    order = 1,threshold = 75, superior = FALSE)
# add a layout
layoutLayer(title = "Multiscalar synthesis - Income per household 2013",
            sources = "GEOFLA<U+00AE> 2015 v2.1, Apur, impots.gouv.fr",
            north = TRUE, scale = 5, tabtitle = TRUE, frame = FALSE, theme = "red.pal",
            author = "MTA
100: Deviation average
G: Situation as compared to the global context (Grand Paris Area) 
T: Situation as compared to the territorial context (EPT of belonging) 
S: Situation as compared to the neigbourhood context (contiguity order 1)")

# add labels for territorial objects under 75 % for all the deviations
labelLayer(x = synthesis[synthesis$mst == 7, ], txt = "LIBCOM", cex = 0.6,
           halo = TRUE)
# }

Run the code above in your browser using DataLab