This project serves as a companion to the Cambridge Manuals in Archaeology book Network Science in Archaeology by Tom Brughmans and Matthew A. Peeples (2023).
This document contains a series of tutorials that outline methods for managing, analyzing, and visualizing network data, primarily using the R programming language. We provide code and examples to replicate the analyses presented in the book as well as many other useful tools. The bulk of this Online Companion is designed to be used with the book in hand to expand on topics covered in the published version. Part I of this document (see the Table of Contents) is focused on helping you get started in R and R-Studio. Part II which includes sections 2 through 7 corresponds to the topics and information covered in Chapters 2 through 7 of the Brughmans and Peeples book. Part III (Going Beyond the Book) includes tutorials beyond the scope of the published book including “advanced” topics that require additional detailed description and knowledge of the methods presented in Parts I and II. We plan to continue to add to and expand Part III in the future. You can use the table of contents on the left-hand side of your screen to jump directly to a particular section and the table and contents on the right to navigate within each section. We have also created a quick TOC reference if you are seeking something in particular.
For more information on the book and the authors check out the project website here: archnetworks.net.
Cite this document as:
Peeples, Matthew A. and Tom Brughmans (2023). Online Companion to Network Science in Archaeology. https://archnetworks.net, Accessed 2023-03-21.
The associated book can be cited as
Brughmans, Tom and Matthew A. Peeples (2023). Network Science in Archaeology. Cambridge Manuals in Archaeology. Cambridge University Press, Cambridge, UK.
The tutorials here are designed to complement the text of the associated book (Brughmans and Peeples 2023) but can also stand alone as a guide to implementation of network analyses in R if you have a basic background in network methods and terminology. Although each section of this guide builds upon the previous sections in terms of network concepts and R methods, the sections are each independent in terms of data, examples, and code and can be run out of order if you choose.
A few suggestions on where to start:
- If you are new to network analysis and R, we would suggest going through each section of this document, starting with Part I: Getting Started with R and then going through Part II in order as you following along with the corresponding chapters in the book.
- If you are already familiar with R but new to network analysis, you can start with Section 2 in Part II to set up your data and work space, and then follow along with the remaining numbered sections and associated book chapters as you read.
- If you are already a confident network analyst and R user and are just looking for code chunks to implement something in particular, feel free to skip around. We have tried to make each section as independent as possible so that you can pick and choose what you want to work on. Use the Table of Contents to find topics quickly.
- If you are a real pro and are designing your own network analyses or visualizations, we would love it if you contributed to the project to help this document grow.
Throughout this document we use a few icons to call-out special information or concerns. Keep an eye out for the symbols below:
We use this icon to highlight our discussions of R packages, Python packages, and other software used in this project. Check here for brief overviews and instructions on how to use and configure these packages.
We use this icon to highlight particular areas of concern in our discussion of network methods and R code. In particular, we use this icon to warn you of common errors or pitfalls for particular functions or network methods.
We use this icon to highlight helpful tips for the use of particular network methods or tools.
The most recent version of this document was built with R version 4.2.2 (2022-10-31 ucrt). We suggest you use a recent version of R when attempting to use the code in this document (version 4.2 recommended).
The content of this document is designed to be as accessible and reproducible as possible. The source code used to produce this document along with all of the data used in analyses are available on GitHub. This GitHub repository allows users to open issues, contribute to the document, or help fix typos or other errors (see information about contributing below). We have also opened a GitHub discussion board with this repository where users can ask questions about any data or code in the repository without making edits or issue requests directly.
The easiest way to reproduce this document is to launch the project directly in your browser using Binder. When you click on the link below it will open a browser based instance of R studio with all of the required packages and files. From there you can test and evaluate the code directly.
When you open Binder you will see a window with the Binder logo and a spinning progress wheel. It will typically only take a minute or so to get up and running and then you will see the screen below. Click on the “R-Studio” link under “Notebook” and it will open a new window with an R-Studio instance that you can use just like you would on your own computer. If you click on the Binder link and it is taking a long time, click to “show” the build logs. If you are “lucky” enough to be the first to initialize Binder after a new build of the GitHub project it will take quite a bit longer to get started. Grab a coffee, tea, Dr. Pepper, or other beverage of choice as it may be approximately 30+ minutes before R-Studio loads.
You can also install this repository as an R package directly from GitHub using the following code:
if (!require("devtools")) install.packages("devtools") devtools::install_github("mpeeples2008/ArchNetSci")
This package installation includes all of the dependencies required to run the code in this document and will create folders called “data” and “scripts” in the package installation directory with all of the required files to replicate the analyses in this document.
Finally, you can run the code and generate documents locally using R and R Studio by downloading the entire R repository here: main.zip. Unzip the files and then:
- Open the “ArchNetSci.Rproj” file in R studio.
- Use the
renv::restore()command at the console to install the required packages and dependencies. Note that this is a large document that uses many packages so this may take some time.
- You will then be able to browse the files and execute all of the code in the repository on your own computer.
This online bookdown document has been deployed using the Netlify platform and the badge below shows the current status of the build hosted at https://book.archnetworks.net.
We have created an Archaeological Network Science Channel on the Computational Archaeology Discord Server, which we hope will provide an additional venue for archaeological network practitioners to collaborate, interact, and ask for help with this document or with archaeological networks (and other computational methods) in general. We invite you to use this as a place to ask questions of the authors, to the community at large, or just to chat to other like-minded researchers. Note that this Discord is subject to the same code of conduct we use for the GitHub repository and you must abide by that agreement to participate. We require that you have a Discord account with a verified email address.
The network tutorials in this document are built for users with a basic familiarity with R and R-studio but if you’re just getting started, don’t worry. We have created a detailed guide to Getting started with R. This document covers the installation of the required software and provides a basic introduction to the R programming environment that we hope will be enough to get you started.
If you already have a basic familiarity with R and want to go further, there are numerous additional resources (most are completely free) to help you learn. Some resources we would recommend include R for Data Science (Wickham and Grolemund 2017), Advanced R (Wickham 2019), the R Cookbook, 2nd edition (Long and Teetor 2019), and R in Action and the associated Quick-R website (Kabacoff 2015). In addition to this Ben Marwick has created an excellent repository of resources for using R in archaeology as well as an ever-growing list of archaeological publications that include R code. The website associated with this book (archnetworks.net) includes a list of archaeological articles focused on network research that include data and code. Reproducing published results is, in our experience, one of the best ways to learn advanced techniques and data management in R so we suggest you give it a try.
We welcome contributions to this project from the community and the GitHub platform helps us facilitate that. You will first need to sign up for a GitHub account and log in. If you find something that needs updating or changing (typos or errors) you can simply click the “Edit source” link at the right sidebar on the relevant page and then click the edit icon found near the top of the code block and make your proposed changes. These changes will be saved in a new “fork” of the document and we will review these and implement them where relevant and happily add your name to our list of contributors. Note that we generally use the tidyverse style guide for formatting code and comments.
If you detect a larger error such as code not running or if you would like to request a new feature or update, you can create an issue using the issue tracker page associated with the project repository.
All contributors must agree to adhere to our code of conduct.
We are devoted to seeing the community of archaeological network practitioners grow and we hope our book and these online resources will help to make this happen. You can support the growth of our community too!
- Spread the word to your friends and colleagues
- Share links to these online resources on social media using the #archnetworks hashtag
- Please cite the book and the Online Companion if you use methods or code from this document. Citation Info
- Star the GitHub project repository and contribute to the project
- Join the Computational Archaeology Discord and invite other interested people
- Share articles, teaching resources, data, or other archaeological network materials for posting on our associated website (archnetworks.net)
This Online Companion to Archaeological Network Science is licensed under a Creative Commons Attribution-NonCommercial-NoDerivitives 4.0 International License.
This online bookdown project and the associated book were made possible thanks to the support of several generous funding sources including: The Carlsberg Foundation, in the context of the Past Social Networks Project (CF21-0382); the National Science Foundation through both the Archaeology and the Measurement, Methodology, and Statistics programs (grant #1758690 and #1758606); and the School of Human Evolution and Social Change at Arizona State University. Thank you to Jens Emil Bødstrup Christoffersen for providing detailed comments on and for testing the initial version of this online bookdown document. Any errors that remain are our own.