-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
343 lines (282 loc) · 12 KB
/
README.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
---
output: github_document
---
# aSCAC (*Archive des styles de céramique en Afrique centrale*)
**Dirk Seidensticker**
```{r setup, include=FALSE}
library(concaveman)
library(ggplot2)
library(ggthemes)
library(raster)
#library(rgdal)
library(rnaturalearth)
library(sf)
library(spdep)
library(tidyverse)
library(viridis)
land50 <- ne_download(scale = 50, type = "land", category = "physical", returnclass="sf")
rivers50 <- ne_download(scale = 50, type = "rivers_lake_centerlines", category = "physical", returnclass = "sf")
coast50 <- ne_download(scale = 50, type = 'coastline', category = 'physical', returnclass = "sf")
lakes50 <- ne_download(scale = 50, type = "lakes", category = "physical", returnclass="sf")
boundary_lines_land50 <- ne_download(scale = 50, type = 'boundary_lines_land', category = 'cultural', returnclass = "sf")
sites <- data.table::fread("sites.csv", encoding = "UTF-8") %>%
st_as_sf(crs = 4326,
coords = c("LONG",
"LAT"),
remove = FALSE,
na.fail = F)
pottery <- data.table::fread("potterygroups.csv", encoding = "UTF-8")
sites.meta <- sites %>%
dplyr::left_join(pottery, by = "POTTERY")
```
This repository contains an archive of pottery groups in Central Africa.
The initial version of the data was first published in:
Seidensticker, D., W. Hubau, D. Verschuren, C. Fortes-Lima, P. de Maret, C.M. Schlebusch & K. Bostoen. 2021. Population Collapse in Congo Rainforest from AD 400 Urges Reassessment of the Bantu Expansion. Science Advances 7. https://doi.org/10.1126/sciadv.abd8352. (data: https://github.com/dirkseidensticker/HumActCentralAfrica_Paper)
```{r analysis, include=FALSE}
breaks <- seq(-1000, 2000, 100)
class <- seq(1,length(breaks), 1)
breaks <- data.frame(breaks, class)
for(i in 1:nrow(breaks)){
breaks[i, "labels"] <- paste0(breaks[i,"class"], ": ", breaks[i,"breaks"], "/", breaks[i+1,"breaks"])
}
# Frequency of sites per pottery group
# pottery.sites.freq <- as.data.frame(stats::aggregate(SITE ~ POTTERY,
# data = sites,
# FUN = length))
pottery.sites.freq <- as.data.frame(
stats::aggregate(
LAT + LONG ~ POTTERY,
data = sites %>%
dplyr::distinct(LAT, LONG, POTTERY),
FUN = length))
names(pottery.sites.freq) <- c("POTTERY", "SITE")
# Area per pottery group (Convex hull)
# see https://github.com/joelgombin/concaveman
id <- dplyr::filter(pottery.sites.freq, SITE > 2)
pottery.sites.area <- sf::st_multipolygon()
pottery.sites.area <- st_sf(polygons = st_sfc(st_polygon()))
sf::st_crs(pottery.sites.area) <- (4326)
pottery.sites.area$POTTERY <- NA
for(i in 1:nrow(id)){
sites.f <- dplyr::filter(sites, POTTERY == id[i,1])
conc.hull <- concaveman(sites.f)
conc.hull$POTTERY = id[i, "POTTERY"]
pottery.sites.area <- rbind(pottery.sites.area, conc.hull)
}
pottery.sites.area$AREA <- sf::st_area(pottery.sites.area)
pottery.sites.area$AREA <- as.numeric(pottery.sites.area$AREA)/1E9 # convert m2 into k(ilo) km2
pottery.sites.area <- pottery.sites.area %>%
dplyr::left_join(pottery, by = "POTTERY")
# Frequency of pottery groups per bin
pottery.cent <- data.frame(matrix(ncol = ncol(pottery)+1, nrow = 0))
x <- c(names(pottery), "CLASS")
colnames(pottery.cent) <- x
for (i in 1:length(pottery$POTTERY)){
for (j in 1:(nrow(breaks)-1)) {
if(pottery[i,"TO"] > breaks[j,"breaks"] &
pottery[i,"FROM"] < breaks[j+1,"breaks"]){
l <- pottery[i,]
l$CLASS <- breaks[j,"labels"]
pottery.cent <- rbind(pottery.cent, as.data.frame(l))
}
}
}
pottery.cent$AGE <- (as.numeric(sub("/.*", "", sub(".*? ", "", pottery.cent$CLASS))) + as.numeric(sub(".*/", "", sub(".*? ", "", pottery.cent$CLASS)))) / 2
pottery.cent$AGE.jitter <- jitter(pottery.cent$AGE, 2)
# Frequency of pottery groups per 100 years
pottery.cent.freq <- as.data.frame(table(pottery.cent$AGE))
pottery.cent.freq$Var1 <- as.numeric(as.character(pottery.cent.freq$Var1))
# merge into meta tables
pottery.cent.meta <- pottery.cent %>%
dplyr::select(-DESCRIPTION) %>%
dplyr::left_join(pottery.sites.freq, by = "POTTERY") %>%
dplyr::left_join(pottery.sites.area, by = "POTTERY")
sites.cent <- merge(x = sites, # merge sites per style with class (200-year century list)
y = dplyr::select(pottery.cent, -DESCRIPTION),
by = "POTTERY",
allow.cartesian = TRUE)
# Distance of sites pertaining to the same style
# see https://github.com/dirkseidensticker/HumActCentralAfrica_Paper/blob/main/response_eLetter_Giresse_etal.Rmd#L95-L159
index <- unique(sites$POTTERY)
res.lst <- list()
for(i in 1:length(index)){
sel <- dplyr::filter(sites, POTTERY == index[i])
if(nrow(sel) >= 5){
sel.cords <- sf::st_coordinates(sel)
sel.knn <- spdep::knearneigh(sel.cords,
k = 4,
longlat = TRUE)
sel.dist <- spdep::nbdists(
spdep::knn2nb(sel.knn),
sel.cords,
longlat = TRUE
)
res.lst[[i]] <- data.frame(POTTERY = index[i],
MEDIAN = median(unlist(sel.dist)))
}
}
knn.res <- do.call(rbind, res.lst)
pottery.knn <- merge(
x = pottery,
y = knn.res,
by = "POTTERY")
breaks <- seq(-1000, 2000, 100)
class <- seq(1,length(breaks), 1)
breaks <- data.frame(breaks, class)
for(i in 1:nrow(breaks)){breaks[i, "labels"] <- paste0(breaks[i,"class"], ": ", breaks[i,"breaks"], "/", breaks[i+1,"breaks"])}
pottery.res <- data.frame(matrix(ncol = ncol(pottery.knn)+1, nrow = 0))
x <- c(names(pottery.knn), "CLASS")
colnames(pottery.res) <- x
for (i in 1:length(pottery.knn$POTTERY)){
for (j in 1:(nrow(breaks)-1)) {
if(pottery.knn[i,"TO"] > breaks[j,"breaks"] &
pottery.knn[i,"FROM"] < breaks[j+1,"breaks"]){
l <- pottery.knn[i,]
l$CLASS <- breaks[j,"labels"]
pottery.res <- rbind(pottery.res, as.data.frame(l))
}
}
}
pottery.res$AGE <- (as.numeric(sub("/.*", "", sub(".*? ", "", pottery.res$CLASS))) + as.numeric(sub(".*/", "", sub(".*? ", "", pottery.res$CLASS)))) / 2
pottery.res$AGE.jitter <- jitter(pottery.res$AGE, 2)
```
```{r stats, warning = FALSE, echo = FALSE, fig.dim = c(6, 8), fig.align = 'center', dpi = 300, out.width = '75%', fig.cap="Fig. 1: Evolution of the numerical abundance and geographical distribution of pottery styles in the Congo rainforest over the past 3000 years (see Seidensticker et al. 2021: Fig. 3)."}
freq.plt <- ggplot() +
geom_bar(data = pottery.cent.freq,
aes(x = Var1,
weight = Freq),
fill = "white",
color = "#333333",
width = 75) +
scale_x_continuous(expand = c(0, 0)) +
scale_y_continuous("Number of \n pottery groups",
expand = c(0, 0)) +
theme_classic() +
theme(axis.title.x = element_blank(),
axis.text.x = element_blank(),
axis.ticks.x = element_blank())
qty.sites.plt <- ggplot() +
geom_boxplot(data = pottery.cent.meta,
aes(x = AGE,
y = SITE,
group = AGE),
outlier.shape = 3,
width = 75) +
scale_x_continuous(expand = c(0, 0)) +
scale_y_sqrt("Number of sites\n per pottery group",
expand = c(0, 0)) +
theme_classic() +
theme(axis.title.x = element_blank(),
axis.text.x = element_blank(),
axis.ticks.x = element_blank())
area.plt <- ggplot() +
geom_boxplot(data = pottery.cent.meta,
aes(x = AGE,
y = AREA,
group = AGE),
outlier.shape = 3,
width = 75) +
scale_x_continuous(expand = c(0, 0)) +
scale_y_sqrt("Distribution area of \n pottery groups (1000 km^2)",
expand = c(0, 0)) +
theme_classic() +
theme(axis.title.x = element_blank(),
axis.text.x = element_blank(),
axis.ticks.x = element_blank())
dist.plt <- ggplot(pottery.res,
aes(x = AGE.jitter,
y = MEDIAN,
group = AGE)) +
geom_boxplot(outlier.shape = 3,
width = 75) +
scale_x_continuous("cal BCE/CE",
limits = c(-1000, 1800),
breaks = seq(-1000, 1800, 500)) +
scale_y_continuous("Median distance (km)", expand = c(0, 0)) +
theme_classic()
cowplot::plot_grid(freq.plt,
qty.sites.plt,
area.plt,
dist.plt,
ncol = 1,
align = "v", axis = "lr",
labels = "auto",
rel_heights = c(1, 1, 1, 1.2))
```
```{r map, warning = FALSE, echo = FALSE, fig.align = 'center', fig.dim = c(8, 6), dpi = 300, out.width = '100%', fig.cap="Fig. 2: Map of the distribution areas of pottery styles through time"}
# set label:
lbl <- unique(pottery.cent.meta[,c("AGE", "CLASS")]) %>%
dplyr::filter(CLASS != "30: 1900/2000")
lbl$CLASS <- sub(".*? ", "", lbl$CLASS)
lbl <- setNames(lbl$CLASS, lbl$AGE)
ggplot() +
geom_sf(data = land50, fill = "white", color = NA) +
#geom_raster(data = rfs.bd1.7, aes(y = y, x = x), fill = '#00734d') +
#geom_raster(data = rfs.bd5, aes(y = y, x = x), fill = '#2b916a') +
#geom_raster(data = subset(rfs.bd17, x < 20), aes(y = y, x = x), fill = '#54eeb7') +
#geom_raster(data = rfs.bd26, aes(y = y, x = x), fill = '#44afe3') +
geom_sf(data = coast50, size = .5, color = 'darkgrey') +
geom_sf(data = rivers50, size = .5, color = 'darkgrey') +
geom_sf(data = lakes50, fill = 'darkgrey', color = NA) +
geom_sf(data = boundary_lines_land50, linewidth = .1, linetype = "dashed", color = 'black') +
geom_sf(data = pottery.cent.meta %>%
dplyr::filter(CLASS != "30: 1900/2000") %>%
sf::st_as_sf(),
aes(fill = AGE)) +
scale_x_continuous(breaks = seq(10, 30, 10)) +
scale_y_continuous(breaks = seq(-10, 10, 10)) +
scale_fill_viridis() +
facet_wrap(AGE ~ .,
labeller = labeller(AGE = lbl)) +
coord_sf(xlim = c(8, 27),
ylim = c(-10, 6)) +
theme_few() +
theme(panel.background = element_rect(fill = "#dcdcdc"),
plot.background = element_rect(color = NA,
fill = NA),
axis.text = element_blank(),
axis.ticks = element_blank())
```
## Datasets
> TODO
### sites.csv
A list of sites and the described pottery styles / groups that were found there:
| Datafield | Description |
| --------- | ----------- |
| REGION | Region (cf. Seidensticker et al. 2021) |
| SITE | Name of the site |
| LAT | Latitude |
| LONG | Longitude |
| POTTERY | Pottery style (cf. `potterygroups.csv`) |
| SOURCE | Source |
### potterygroups.csv
| Datafield | Description |
| --------- | ----------- |
| ID | |
| POTTERY | Name of the pottery group / style |
| FROM | maximum age |
| TO | minimal age |
| DESCRIPTION | A description of the chronological arguments of the group (cf. Seidensticker et al. 2021 Data S2) |
| REGION | Region (cf. Seidensticker et al. 2021) |
| COL | a hexadecimal color code for plott (cf. Seidensticker 2021 Ch. 5) |
### potterydrawings.csv
This dataset contains a list of drawn pottery sherds and vessels with their sources and as much metadata as could be extracted from the literature. It further contains measurements (cf. Seidensticker 2021, pp. 31-32 Abb. 6).
<p float="left">
<img src="README_files/potterydrawings_panel.png" width="49%" />
<img src="README_files/potterydrawings_stack.png" width="49%" />
</p>
| Datafield | Description |
| --------- | ----------- |
| SITE | Name of the site (cf. `site.csv`) |
| FEATURE | |
| OBJECT | |
| POTTERY | Pottery style (cf. `potterygroups.csv`) |
| TypeOrig | |
| muendungsD | diameter at the mouth |
| muendungsH | height at the mouth (maximal height) |
| minD | minimal diameter |
| minD_H | height at the minimal diameter (above base) |
| maxD | maximum diameter |
| maxD_H | height at the maximum diameter (above base) |
| bodenD | diameter of the base |
| SOURCE | Sourece |