You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A rather common problem in archaeology is the fuzziness of dates assigned to objects. If one wants to visualize overall changes in - let's say - pottery consumption, bar charts often fall short in that regard. If we have Phases a -- f, then some of the objects can usually be dated to a, c, and f, as an example, but others will by classified as "a to c" or "b to c". But how can these data still be used for examining changes in a large set of objects?
25
32
26
33
First, it is handy to translate the phases into numbers, for which we should conveniently choose the 'actual' dating. This may cause other problems in the end, since such phases are often employed to avoid dates, but it is necessary as the aim is to visualize the distribution on a continuous scale, for which numbers are needed. Also, this step may be reversed for the final visualization but supplementing or replacing the scale on the x-axis with the respective phases.
27
34
Ideally, one can produce a 'beginning' and 'end' date for each object, or let's say an earliest possible dating and a latest possible dating, e.g. corresponding to beginning and start of each phase the object is dated to.
28
35
29
-
To show and explain how this would work, I chose a random sample of athenian pottery from the beazley archive ([@BAPD]), as it is a large publicly available dataset. (Since the format provided by the BAPD is slightly different from that needed here I converted the data beforehand to match my requirements. No values have been changed.)
36
+
To show and explain how this would work, I chose a random sample of athenian pottery from the beazley archive ([@BAPD]), as it is a large publicly available dataset. (Since the format provided by the BAPD is slightly different from that needed here I converted the data beforehand to match my requirements. No values have been changed. The sample dataset is included in datplot.)
30
37
31
38
```{r prep}
32
39
library(datplot)
@@ -48,18 +55,27 @@ This method will not be useful for dating specific context, since any concept of
48
55
Other approaches, e.g. using the median date of each object, may often produce similar outcomes, but create other problems. A lot of information is lost on the way when employing averaged or median data, as large amount of loosely dated objects will produce peaks at unreasonable values. (Consider a large amount of objects dated between 600 and 400 BCE all attributed to the year 500 BCE.)
ggplot(Beazley, aes(x = DAT_mean, fill = Technique)) +
61
+
geom_histogram() + plot_theme + plot_fill
55
62
```
56
63
57
64
Employing dating steps will even out unreasonable peaks. Not especially the gap between -425 and -300 in the plot above, that is -- in the plot below -- filled with a constant amount of objects in each year. This is due to the data containing large amounts of objects dating from -400 to -300 BCE. Of couse, due to duplicating each object numerous times (see table below), the counts represented on the y-axis have become meaningless.
58
65
59
-
```{rsteps}
66
+
```{rsteps1}
60
67
library(datplot)
61
68
result <- datsteps(Beazley, stepsize = 5)
62
-
hist(result$DAT_step)
69
+
ggplot(result, aes(x = DAT_step, fill = variable)) +
70
+
geom_histogram() + plot_theme + plot_fill
71
+
```
72
+
73
+
`datsteps()` can also calculate a stepsize on its own. It equals the closest possible dating of any object.
74
+
75
+
```{r steps2}
76
+
result <- datsteps(Beazley, stepsize = "auto")
77
+
ggplot(result, aes(x = DAT_step, fill = variable)) +
78
+
geom_histogram() + plot_theme + plot_fill
63
79
```
64
80
65
81
@@ -70,6 +86,7 @@ kable(head(result))
70
86
Due to the impossibility of displaying object counts as well, it is ideal to use kernel density estimates for visualization. The density plot below shows the result. The peak at around -500 indicates that is area has the highest overlay, so a large part of the objects in our sample have been dated around this time. The same distribution can also be seen in the bar plots above. This, however, is not yet very informative.
71
87
72
88
```{r density one}
89
+
result <- datsteps(Beazley, stepsize = 25)
73
90
dens <- result
74
91
dens$weight <- (dens$weight / sum(dens$weight))
75
92
dens <- density(x = dens$DAT_step, weights = dens$weight)
@@ -98,25 +115,20 @@ kable(head(result))
98
115
In the case of the beazley archives data [@BAPD] we can clearly see what we knew before: Black-figure pottery is older than red-figure pottery. (The data are from a random sample of athenian pottery from the beazley archive, n = 1000. Computation of the dating steps may not work with very, very large datasets, or simply take up a lot of time.)
99
116
100
117
```{r ggplot, warning=FALSE}
101
-
library(ggplot2)
102
118
ggplot(data = result, aes(x = DAT_step,
103
-
color = variable,
104
119
fill = variable)) +
105
120
geom_density(aes(weight = weight), alpha = 0.5) +
106
-
xlab("Dating") +
107
-
theme(panel.background = element_blank())
121
+
xlab("Dating") + plot_theme + plot_fill
108
122
```
109
123
110
124
111
125
Please note that the plot does change when the weights are omitted (see plot below). When every step is valued equally, a lot of steps fall into the end of the 4th century (as mentioned above), since they were dated as e.g. "-400 to -300".
0 commit comments