plot_bidev: Plot Multiscalar Typology (2 deviations)

plot_bidevR Documentation

Plot Multiscalar Typology (2 deviations)

Description

Vizualizing bidev and select some territorial units on it.

Usage

plot_bidev(
  x,
  dev1,
  dev2,
  breaks = c(25, 50, 100),
  dev1.lab = NULL,
  dev2.lab = NULL,
  lib.var = NULL,
  lib.val = NULL,
  cex.lab = 1,
  cex.axis = 0.7,
  cex.pt = 0.5,
  cex.names = 0.8,
  pos.names = 4
)

Arguments

x

a sf object or a dataframe including 2 pre-calculated deviations.

dev1

column name of the first relative deviation in x.

dev2

coumn name of the second relative deviation in x.

breaks

distance to the index 100 (average of the context), in percentage. A vector of three values. Defaut c(25,50,100). 25 to indexes 80 and 125. 50 and 200.

dev1.lab

label to be put in x-axis of the scatter plot (default: NULL).

dev2.lab

label to be put in y-axis of the scatter plot (default: NULL).

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 label text (default = 1).

cex.axis

size of the tick label numbers (default = 0.7).

cex.pt

size of the dot used for extract specific territorial units (default 0.5).

cex.names

size of the territorial units labels if selected (default 0.8).

pos.names

position of territorial units labels (default 4, to the right).

Value

A scatter-plot displaying the 13 bidev categories, which are the synthesis of the position of territorial units according to 2 deviations and their respective distance to the average. X-Y axis are expressed in logarithm (25 being index 80).

bidev typology values :

  • ZZ: Near the average for the two selected deviation, in grey

  • A1: Above the average for dev1 and dev2, distance to the avarage : +, in light red

  • A2: Above the average for dev1 and dev2, distance to the avarage : ++, in red

  • A3: Above the average for dev1 and dev2, distance to the avarage : +++, in dark red

  • B1: Above the average for dev1 and below for dev2, distance to the avarage : +, in light yellow

  • B2: Above the average for dev1 and below for dev2, distance to the avarage : ++, in yellow

  • B3: Above the average for dev1 and below for dev2, distance to the avarage : +++, in dark yellow

  • C1: Below the average for dev1 and dev2, distance to the avarage : +, in light blue

  • C2: Below the average for dev1 and dev2, distance to the avarage : ++, in blue

  • C3: Below the average for dev1 and dev2, distance to the avarage : +++, in dark blue

  • D1: Below the average for dev1 and above for dev2, distance to the avarage : +, in light green

  • D2: Below the average for dev1 and above for dev2, distance to the avarage : ++, in green

  • D3: Below the average for dev1 and above for dev2, distance to the avarage : +++, in dark green

Examples

# Load data
library(sf)
com <- st_read(system.file("metroparis.gpkg", package = "MTA"), layer = "com", quiet = TRUE)

# Prerequisite  - Compute 2 deviations
com$gdev <- gdev(x = com, var1 = "INC", var2 = "TH")
com$tdev <- tdev(x = com, var1 = "INC", var2 = "TH", key = "EPT")

# EX1 standard breaks with four labels
plot_bidev(x = com, 
           dev1 = "gdev", 
           dev2 = "tdev",
           dev1.lab = "General deviation (MGP Area)",
           dev2.lab = "Territorial deviation (EPT of belonging)",
           lib.var = "LIBCOM",
           lib.val =  c("Marolles-en-Brie", "Suresnes", 
                        "Clichy-sous-Bois", "Les Lilas"))

# EX2, change breaks, enlarge breaks 
plot_bidev(x = com,
           breaks = c(75, 150, 300),
           dev1 = "gdev", 
           dev2 = "tdev", 
           dev1.lab = "General deviation (MGP Area)",
           dev2.lab = "Territorial deviation (EPT of belonging)")

MTA documentation built on Nov. 2, 2023, 5:06 p.m.