Skip to content

Commit

Permalink
fixed typos in diffusion and rerendered whole book
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeeples2008 committed Jul 5, 2022
1 parent dbddd7f commit dafa3fc
Show file tree
Hide file tree
Showing 38 changed files with 795 additions and 181 deletions.
2 changes: 1 addition & 1 deletion 03-exploratory-analysis.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ names <- c("003", "012", "102", "021D", "021U", "021C",
for (i in 0:15) {
g_temp <- graph_from_isomorphism_class(size = 3,
number = i,
directed = T)
directed = TRUE)
g[[i + 1]] <- ggraph(g_temp,
layout = "manual",
x = xy[, 1],
Expand Down
6 changes: 3 additions & 3 deletions 10-diffusion.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ We can also plot the adoption curve across all time steps using the `plot_adopte
plot_adopters(net_test1)
```

This result shows the classic S-shaped curve for cumulative adoption with the parameters we've provided where adoption is at first slow, followed by a period of rapid adoption, and then a gradual slowdown as adoptions reaches saturation.
These results show the classic S-shaped curve for cumulative adoption with the parameters we've provided where adoption is at first slow, followed by a period of rapid adoption, and then a gradual slowdown as adoptions reaches saturation.

We can also plot a network that shows the time step at which each node adopted the contagion:

Expand Down Expand Up @@ -270,7 +270,7 @@ ggmap(my_map) +
theme_void()
```

As this map illustrates, and as we would expect, nodes closest to the initial adopters are the earliest adopters. Further the area in the southern portion of the study area shows a dense collection of nodes colored gray indicating they did not adopt in the 20 time steps we assessed.
As this map illustrates, nodes closest to the initial adopters are the earliest adopters. Further the area in the southern portion of the study area shows a dense collection of nodes colored gray indicating they did not adopt in the 20 time steps we assessed.

Let's now create another adopter plot and map color coded by time of adoption. In the next example, we leave everything alone but this time set the initial adopters as nodes 6 and 7 in the northwestern portion of the study area:

Expand Down Expand Up @@ -444,6 +444,6 @@ ggplot(data = df) +
theme_bw()
```

As this boxplot illustrates, sites that were in the "Early Adopter" or "Early Majority" category generally have earlier starting dates than those in the other categories. This may suggest that network distance from Chaco Canyon (where we originated our "contagion" and where the earliest Great Houses are found) may have been a factor in the establishment of Chacoan complexes outside of Chaco. Of Course, if wanted to take this further we would need to assess the variable roles of spatial distance, network distance, and perhaps could even consider material cultural similarity data. At this point, however, this brief example at least points out that there is an interesting pattern worth investigation. Further, this example demonstrates one simple approach that could be used to compare diffusion models to other archaeological data.
As this boxplot illustrates, sites that were in the "Early Adopter" or "Early Majority" category include the vast majority of sites that have earlier starting dates though the median is the same across groups. This may suggest that network distance from Chaco Canyon (where we originated our "contagion" and where the earliest Great Houses are found) may have been a factor in the establishment of Chacoan complexes outside of Chaco. Of Course, if wanted to take this further we would need to assess the variable roles of spatial distance, network distance, and perhaps could even consider material cultural similarity data. At this point, however, this brief example at least points out that there is an interesting pattern worth investigation. Further, this example demonstrates one simple approach that could be used to compare diffusion models to other archaeological data.

We have only scratched the surface on the network methods that can be used to study diffusion here. There are many other advanced models that may be relevant for archaeological analysis including many interesting [Epidemiological Models](http://www.epimodel.org/tut.html) that would likely work well in archaeological context for considerations of all sorts of contagions (social or biological). We hope these brief examples will promote further exploration of such approaches.
16 changes: 0 additions & 16 deletions CITATION.bib

This file was deleted.

4 changes: 4 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ Suggests:
rmarkdown,
netdiffuseR,
ca,
Matrix,
SparseM,
pracma,
graphkernels,
xml2
Encoding: UTF-8
LazyData: true
Expand Down
Binary file added __pycache__/portrait_divergence.cpython-38.pyc
Binary file not shown.
4 changes: 4 additions & 0 deletions _book/01-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,16 +255,19 @@ This version of the book was built with R version 4.2.0 (2022-04-22 ucrt) and th
|ggrepel |0.9.1 |CRAN (R 4.2.0) |
|ggsn |0.5.0 |CRAN (R 4.2.0) |
|GISTools |0.7-4 |CRAN (R 4.2.0) |
|graphkernels |1.6.1 |CRAN (R 4.2.0) |
|igraph |1.3.1 |CRAN (R 4.2.0) |
|intergraph |2.0-2 |CRAN (R 4.2.0) |
|knitr |1.39 |CRAN (R 4.2.0) |
|latticeExtra |0.6-29 |CRAN (R 4.2.0) |
|maptools |1.1-4 |CRAN (R 4.2.0) |
|Matrix |1.4-1 |CRAN (R 4.2.0) |
|multinet |4.0.1 |CRAN (R 4.2.0) |
|netdiffuseR |1.22.3 |CRAN (R 4.2.0) |
|networkD3 |0.4 |CRAN (R 4.2.0) |
|networkDynamic |0.11.2 |CRAN (R 4.2.0) |
|patchwork |1.1.1 |CRAN (R 4.2.0) |
|pracma |2.3.8 |CRAN (R 4.2.0) |
|RColorBrewer |1.1-3 |CRAN (R 4.2.0) |
|Rcpp |1.0.8.3 |CRAN (R 4.2.0) |
|reshape2 |1.4.4 |CRAN (R 4.2.0) |
Expand All @@ -274,6 +277,7 @@ This version of the book was built with R version 4.2.0 (2022-04-22 ucrt) and th
|rmarkdown |2.14 |CRAN (R 4.2.0) |
|scatterplot3d |0.3-41 |CRAN (R 4.2.0) |
|sf |1.0-7 |CRAN (R 4.2.0) |
|SparseM |1.81 |CRAN (R 4.2.0) |
|statnet |2019.6 |CRAN (R 4.2.0) |
|superheat |0.1.0 |CRAN (R 4.2.0) |
|tidyverse |1.3.1 |CRAN (R 4.2.0) |
Expand Down
82 changes: 41 additions & 41 deletions _book/02-network-data-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ cibola_net
```

```
## IGRAPH 7daf077 UN-- 30 167 --
## IGRAPH 8dc4fdd UN-- 30 167 --
## + attr: name (v/c)
## + edges from 7daf077 (vertex names):
## + edges from 8dc4fdd (vertex names):
## [1] Apache Creek--Casa Malpais Apache Creek--Coyote Creek
## [3] Apache Creek--Hooper Ranch Apache Creek--Horse Camp Mill
## [5] Apache Creek--Hubble Corner Apache Creek--Mineral Creek Pueblo
Expand Down Expand Up @@ -138,7 +138,7 @@ adj_list$`Apache Creek`
```

```
## + 11/167 edges from 7daf077 (vertex names):
## + 11/167 edges from 8dc4fdd (vertex names):
## [1] Apache Creek--Casa Malpais Apache Creek--Coyote Creek
## [3] Apache Creek--Hooper Ranch Apache Creek--Horse Camp Mill
## [5] Apache Creek--Hubble Corner Apache Creek--Mineral Creek Pueblo
Expand All @@ -154,7 +154,7 @@ adj_list[[2]]
```

```
## + 11/167 edges from 7daf077 (vertex names):
## + 11/167 edges from 8dc4fdd (vertex names):
## [1] Apache Creek--Casa Malpais Casa Malpais--Coyote Creek
## [3] Casa Malpais--Hooper Ranch Casa Malpais--Horse Camp Mill
## [5] Casa Malpais--Hubble Corner Casa Malpais--Rudd Creek Ruin
Expand Down Expand Up @@ -351,9 +351,9 @@ cibola_net2
```

```
## IGRAPH 7de07b9 UN-- 31 167 --
## IGRAPH 8df9547 UN-- 31 167 --
## + attr: name (v/c), region (v/c)
## + edges from 7de07b9 (vertex names):
## + edges from 8df9547 (vertex names):
## [1] Apache.Creek--Casa.Malpais Apache.Creek--Coyote.Creek
## [3] Apache.Creek--Hooper.Ranch Apache.Creek--Horse.Camp.Mill
## [5] Apache.Creek--Hubble.Corner Apache.Creek--Mineral.Creek.Pueblo
Expand Down Expand Up @@ -409,9 +409,9 @@ simple_net_i
```

```
## IGRAPH 7edae9c UN-- 31 167 --
## IGRAPH 8eed013 UN-- 31 167 --
## + attr: name (v/c)
## + edges from 7edae9c (vertex names):
## + edges from 8eed013 (vertex names):
## [1] Apache.Creek--Casa.Malpais Apache.Creek--Coyote.Creek
## [3] Apache.Creek--Hooper.Ranch Apache.Creek--Horse.Camp.Mill
## [5] Apache.Creek--Hubble.Corner Apache.Creek--Mineral.Creek.Pueblo
Expand Down Expand Up @@ -476,9 +476,9 @@ directed_net
```

```
## IGRAPH 7ee54ae DN-- 30 125 --
## IGRAPH 8ef4e9b DN-- 30 125 --
## + attr: name (v/c)
## + edges from 7ee54ae (vertex names):
## + edges from 8ef4e9b (vertex names):
## [1] Coyote Creek ->Techado Springs
## [2] Hubble Corner ->Tri-R Pueblo
## [3] Hubble Corner ->Techado Springs
Expand Down Expand Up @@ -611,9 +611,9 @@ cibola_inc
```

```
## IGRAPH 7f2ff90 UN-B 41 2214 --
## IGRAPH 8f3b690 UN-B 41 2214 --
## + attr: type (v/l), name (v/c)
## + edges from 7f2ff90 (vertex names):
## + edges from 8f3b690 (vertex names):
## [1] Apache Creek--Clust1 Apache Creek--Clust1 Apache Creek--Clust1
## [4] Apache Creek--Clust1 Apache Creek--Clust1 Apache Creek--Clust1
## [7] Apache Creek--Clust1 Apache Creek--Clust2 Apache Creek--Clust2
Expand Down Expand Up @@ -1158,9 +1158,9 @@ ego_nets[[1]]
```

```
## IGRAPH 8190296 UN-- 12 59 --
## IGRAPH 919a9da UN-- 12 59 --
## + attr: name (v/c)
## + edges from 8190296 (vertex names):
## + edges from 919a9da (vertex names):
## [1] Apache Creek --Casa Malpais Apache Creek --Coyote Creek
## [3] Casa Malpais --Coyote Creek Apache Creek --Hooper Ranch
## [5] Casa Malpais --Hooper Ranch Coyote Creek --Hooper Ranch
Expand Down Expand Up @@ -1250,7 +1250,7 @@ multinet::degree_ml(florentine)
```

```
## [1] 3 4 4 11 3 7 2 6 5 6 3 6 3 6 1
## [1] 3 7 2 11 4 4 3 6 5 6 6 3 1 3 6
```

```r
Expand All @@ -1261,30 +1261,30 @@ multinet::glouvain_ml(florentine)

```
## actor layer cid
## 1 Ginori business 0
## 2 Ginori marriage 0
## 3 Albizzi marriage 0
## 4 Barbadori business 0
## 5 Barbadori marriage 0
## 6 Ridolfi marriage 1
## 7 Tornabuoni business 1
## 8 Tornabuoni marriage 1
## 9 Medici business 1
## 10 Medici marriage 1
## 11 Salviati business 1
## 12 Salviati marriage 1
## 13 Pazzi business 1
## 14 Pazzi marriage 1
## 15 Acciaiuoli marriage 1
## 16 Strozzi marriage 2
## 17 Peruzzi business 2
## 18 Peruzzi marriage 2
## 19 Guadagni business 2
## 20 Guadagni marriage 2
## 21 Lamberteschi business 2
## 22 Lamberteschi marriage 2
## 23 Castellani business 2
## 24 Castellani marriage 2
## 1 Salviati business 0
## 2 Salviati marriage 0
## 3 Pazzi business 0
## 4 Pazzi marriage 0
## 5 Medici business 0
## 6 Medici marriage 0
## 7 Tornabuoni business 0
## 8 Tornabuoni marriage 0
## 9 Ridolfi marriage 0
## 10 Albizzi marriage 0
## 11 Acciaiuoli marriage 0
## 12 Ginori business 0
## 13 Ginori marriage 0
## 14 Peruzzi business 1
## 15 Peruzzi marriage 1
## 16 Strozzi marriage 1
## 17 Barbadori business 1
## 18 Barbadori marriage 1
## 19 Castellani business 1
## 20 Castellani marriage 1
## 21 Guadagni business 2
## 22 Guadagni marriage 2
## 23 Lamberteschi business 2
## 24 Lamberteschi marriage 2
## 25 Bischeri business 2
## 26 Bischeri marriage 2
```
Expand Down Expand Up @@ -1317,9 +1317,9 @@ mor_wt_i
```

```
## IGRAPH 822f31f U-W- 31 465 --
## IGRAPH 9210d54 U-W- 31 465 --
## + attr: na (v/l), vertex.names (v/c), na (e/l), weight (e/n)
## + edges from 822f31f:
## + edges from 9210d54:
## [1] 1-- 2 1-- 3 1-- 4 1-- 5 1-- 6 1-- 7 1-- 8 1-- 9 1--10 1--11 1--12 1--13
## [13] 1--14 1--15 1--16 1--17 1--18 1--19 1--20 1--21 1--22 1--23 1--24 1--25
## [25] 1--26 1--27 1--28 1--29 1--30 1--31 2-- 3 2-- 4 2-- 5 2-- 6 2-- 7 2-- 8
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 11 additions & 11 deletions _book/03-exploratory-analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ names <- c("003", "012", "102", "021D", "021U", "021C",
for (i in 0:15) {
g_temp <- graph_from_isomorphism_class(size = 3,
number = i,
directed = T)
directed = TRUE)
g[[i + 1]] <- ggraph(g_temp,
layout = "manual",
x = xy[, 1],
Expand Down Expand Up @@ -588,7 +588,7 @@ igraph::shortest_paths(simple_net, from = 1, to = 21)
```
## $vpath
## $vpath[[1]]
## + 5/31 vertices, named, from 85cf5f8:
## + 5/31 vertices, named, from 959baa5:
## [1] Apache.Creek Casa.Malpais Garcia.Ranch
## [4] Heshotauthla Pueblo.de.los.Muertos
##
Expand Down Expand Up @@ -624,7 +624,7 @@ igraph::farthest_vertices(directed_net, directed = TRUE)

```
## $vertices
## + 2/30 vertices, named, from 85d04f6:
## + 2/30 vertices, named, from 959cc79:
## [1] Apache Creek Pueblo de los Muertos
##
## $distance
Expand Down Expand Up @@ -676,9 +676,9 @@ components

```
## [[1]]
## IGRAPH 884630f UN-- 30 167 --
## IGRAPH 980a918 UN-- 30 167 --
## + attr: name (v/c)
## + edges from 884630f (vertex names):
## + edges from 980a918 (vertex names):
## [1] Apache.Creek--Casa.Malpais Apache.Creek--Coyote.Creek
## [3] Apache.Creek--Hooper.Ranch Apache.Creek--Horse.Camp.Mill
## [5] Apache.Creek--Hubble.Corner Apache.Creek--Mineral.Creek.Pueblo
Expand All @@ -690,9 +690,9 @@ components
## + ... omitted several edges
##
## [[2]]
## IGRAPH 8846335 UN-- 1 0 --
## IGRAPH 980a93a UN-- 1 0 --
## + attr: name (v/c)
## + edges from 8846335 (vertex names):
## + edges from 980a93a (vertex names):
```

```r
Expand Down Expand Up @@ -752,15 +752,15 @@ min_cut(simple_net_noiso, value.only = FALSE)
## [1] 1
##
## $cut
## + 1/167 edge from 85cfbd4 (vertex names):
## + 1/167 edge from 959c0f2 (vertex names):
## [1] Ojo Bonito--Baca Pueblo
##
## $partition1
## + 1/30 vertex, named, from 85cfbd4:
## + 1/30 vertex, named, from 959c0f2:
## [1] Baca Pueblo
##
## $partition2
## + 29/30 vertices, named, from 85cfbd4:
## + 29/30 vertices, named, from 959c0f2:
## [1] Apache Creek Casa Malpais Coyote Creek
## [4] Hooper Ranch Horse Camp Mill Hubble Corner
## [7] Mineral Creek Pueblo Rudd Creek Ruin Techado Springs
Expand Down Expand Up @@ -789,7 +789,7 @@ max_cliques(simple_net, min = 1)[[24]]
```

```
## + 9/31 vertices, named, from 85cf5f8:
## + 9/31 vertices, named, from 959baa5:
## [1] Los.Gigantes Cienega Tinaja Spier.170
## [5] Scribe.S Pescado.Cluster Mirabal Heshotauthla
## [9] Yellowhouse
Expand Down
4 changes: 2 additions & 2 deletions _book/05-visualization.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ cibola_i
```

```
## IGRAPH 934c5c1 UN-- 31 167 --
## IGRAPH a2ecb43 UN-- 31 167 --
## + attr: name (v/c)
## + edges from 934c5c1 (vertex names):
## + edges from a2ecb43 (vertex names):
## [1] Apache.Creek--Casa.Malpais Apache.Creek--Coyote.Creek
## [3] Apache.Creek--Hooper.Ranch Apache.Creek--Horse.Camp.Mill
## [5] Apache.Creek--Hubble.Corner Apache.Creek--Mineral.Creek.Pueblo
Expand Down
4 changes: 2 additions & 2 deletions _book/06-spatial-networks.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ tree1
```

```
## IGRAPH c036ecc U--- 50 49 -- Tree
## IGRAPH ce8790e U--- 50 49 -- Tree
## + attr: name (g/c), children (g/n), mode (g/c)
## + edges from c036ecc:
## + edges from ce8790e:
## [1] 1-- 2 1-- 3 1-- 4 1-- 5 1-- 6 2-- 7 2-- 8 2-- 9 2--10 2--11
## [11] 3--12 3--13 3--14 3--15 3--16 4--17 4--18 4--19 4--20 4--21
## [21] 5--22 5--23 5--24 5--25 5--26 6--27 6--28 6--29 6--30 6--31
Expand Down
Binary file modified _book/09-affiliation_files/figure-html/unnamed-chunk-19-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions _book/10-diffusion.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ plot_adopters(net_test1)

<img src="10-diffusion_files/figure-html/unnamed-chunk-4-1.png" width="672" />

This result shows the classic S-shaped curve for cumulative adoption with the parameters we've provided where adoption is at first slow, followed by a period of rapid adoption, and then a gradual slowdown as adoptions reaches saturation.
These results show the classic S-shaped curve for cumulative adoption with the parameters we've provided where adoption is at first slow, followed by a period of rapid adoption, and then a gradual slowdown as adoptions reaches saturation.

We can also plot a network that shows the time step at which each node adopted the contagion:

Expand Down Expand Up @@ -479,7 +479,7 @@ ggmap(my_map) +

<img src="10-diffusion_files/figure-html/unnamed-chunk-10-1.png" width="672" />

As this map illustrates, and as we would expect, nodes closest to the initial adopters are the earliest adopters. Further the area in the southern portion of the study area shows a dense collection of nodes colored gray indicating they did not adopt in the 20 time steps we assessed.
As this map illustrates, nodes closest to the initial adopters are the earliest adopters. Further the area in the southern portion of the study area shows a dense collection of nodes colored gray indicating they did not adopt in the 20 time steps we assessed.

Let's now create another adopter plot and map color coded by time of adoption. In the next example, we leave everything alone but this time set the initial adopters as nodes 6 and 7 in the northwestern portion of the study area:

Expand Down Expand Up @@ -715,6 +715,6 @@ ggplot(data = df) +

<img src="10-diffusion_files/figure-html/unnamed-chunk-16-1.png" width="672" />

As this boxplot illustrates, sites that were in the "Early Adopter" or "Early Majority" category generally have earlier starting dates than those in the other categories. This may suggest that network distance from Chaco Canyon (where we originated our "contagion" and where the earliest Great Houses are found) may have been a factor in the establishment of Chacoan complexes outside of Chaco. Of Course, if wanted to take this further we would need to assess the variable roles of spatial distance, network distance, and perhaps could even consider material cultural similarity data. At this point, however, this brief example at least points out that there is an interesting pattern worth investigation. Further, this example demonstrates one simple approach that could be used to compare diffusion models to other archaeological data.
As this boxplot illustrates, sites that were in the "Early Adopter" or "Early Majority" category include the vast majority of sites that have earlier starting dates though the median is the same across groups. This may suggest that network distance from Chaco Canyon (where we originated our "contagion" and where the earliest Great Houses are found) may have been a factor in the establishment of Chacoan complexes outside of Chaco. Of Course, if wanted to take this further we would need to assess the variable roles of spatial distance, network distance, and perhaps could even consider material cultural similarity data. At this point, however, this brief example at least points out that there is an interesting pattern worth investigation. Further, this example demonstrates one simple approach that could be used to compare diffusion models to other archaeological data.

We have only scratched the surface on the network methods that can be used to study diffusion here. There are many other advanced models that may be relevant for archaeological analysis including many interesting [Epidemiological Models](http://www.epimodel.org/tut.html) that would likely work well in archaeological context for considerations of all sorts of contagions (social or biological). We hope these brief examples will promote further exploration of such approaches.
Binary file modified _book/10-diffusion_files/figure-html/unnamed-chunk-10-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion _book/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ <h1>Page not found<a class="anchor" aria-label="anchor" href="#page-not-found"><
<footer class="bg-primary text-light mt-5"><div class="container"><div class="row">

<div class="col-12 col-md-6 mt-3">
<p>"<strong>Online Companion to <em>Archaeological Network Science</em></strong>" was written by Matthew A. Peeples and Tom Brughmans. It was last built on 2022-06-26.</p>
<p>"<strong>Online Companion to <em>Archaeological Network Science</em></strong>" was written by Matthew A. Peeples and Tom Brughmans. It was last built on 2022-07-05.</p>
</div>

<div class="col-12 col-md-6 mt-3">
Expand Down
Loading

0 comments on commit dafa3fc

Please sign in to comment.