-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathspatialnet.Rmd
122 lines (84 loc) · 3.54 KB
/
spatialnet.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
---
title: ""
output:
html_document:
code_folding: null
df_print: default
toc: yes
---
```{r global_options, include=FALSE}
knitr::opts_chunk$set(fig.width=8, fig.height=5, echo=FALSE, warning=FALSE, message=FALSE, cache = FALSE)
```
```{r,echo=FALSE}
load(file="data/3maps.RData")
load(file="data/maps.classic.RData")
```
```{r}
#knitr::read_chunk('scripts/spatial_net_functions.R')
source('scripts/spatial_net_functions.R', echo = FALSE)
source('scripts/spatial_net.R', echo = F)
source('scripts/spatial_net_map.R', echo = F)
source('scripts/spatial_net_viz.R', echo = F)
source('scripts/leafsync.R', echo = F)
```
<br />
# Core and periphery
A spatial feature of the genre models —Heliodorus’ _Ethiopica_, Cervantes' _Persiles_— is the presence of a geographical division between **core and periphery**. This is an attempt to automatically compute the geographical periphery and center of the places mentioned in a text using network metrics.
The places have been refined manually, e.g., locations like Thule has been added in _Persiles_.
# Methodology
The method consists of converting into spatial networks the geolocated places mentioned in the novels, in order to apply to them measures of centrality (eigenvector values).
The places (converted to spatial points) have been connected with a Delaunay triangulation. The resulted TIN (Triangulated Irregular Network) gets weighted edges based on euclidean distances, so that the value of the weighted edge depends on the distance between points. We applied eigenvector centralities to the graph, resulting in the lowest eigenvector value to the closest points, the highest to the furthest.
The different steps to get from geolocated places to nodes in a graph are visualized below.
To compute the transformations, a set of functions in R by Pebesma [(2013)](https://rpubs.com/edzer/spatialnetworks) were used together with the R packages `deldir` [(Turner 2019)](https://cran.r-project.org/web/packages/deldir) and `ggvoronoi` [(Garrett 2018)](https://doi.org/10.21105/joss.01096). For the measures of centrality the `eigen_centrality` function from the `igraph` package [(Csardi 2019)](https://cran.r-project.org/web/packages/igraph) was applied. Data and maps visualization use `ggplot2` [(Wickham 2016)](https://cran.r-project.org/web/packages/ggplot2) and `leaflet` [(Cheng 2018)](https://cran.r-project.org/web/packages/leaflet).
## Voronoi diagrams
```{r}
plot2_voro
plot4_map
```
## Delaunay triangulation
```{r}
plot1_both
plot3_dela
```
## Graph from a TIN
```{r fig1, message=F}
par(mar = c(0,0,0,0))
plot(grafo,
vertex.size= ifelse(V(grafo)$ec == 1, 8, 3),
vertex.label = NA,
edge.width=E(grafo)$weight/3,
vertex.frame.color = "red",
vertex.color = ifelse(V(grafo)$ec == 1, "blue", "red")
)
```
## Metrics of _Persiles_ (eigenvector centrality)
```{r}
datatable
```
# Plotting metrics on a map
The lowest eigenvector values within the first quantile (Q1) are marked in red.
## _Persiles_ core vs periphery
```{r}
m1
```
## _Peregrino_
```{r}
m2
```
## _Semprilis_
```{r}
m3
```
## _Eustorgio_
```{r}
m4
```
# Comparation of Greek Literature
The geolocations of the _Aethiopica_ and _Odyssey_ are from the [ToposText project](https://topostext.org).
```{r}
retablo.clasico
```
<br />
## Gephi Viz
Oracle of Delphi as geographical center in Heliodorus' _Aethiopica_. The width of the edges represents the distances between points. The network core (Ethiopia, Seres, Egypt,...) shows actually the peripheral places.
