Archaeological Science with R
1
Archaeological Science with R
2
Introduction
2.1
Overview
2.2
Why do archaeologists need to learn to code?
2.3
Why R?
2.4
Who should read this book
2.5
Prerequisites
2.5.1
R
2.5.2
RStudio
2.6
Key terms to understand (don’t skip this bit!)
2.6.1
Packages
2.7
Getting help
2.7.1
Draft TOC
3
Writing reproducible research
3.1
Overview
3.2
What does it mean to do reproducible research?
3.3
Literate programming
3.3.1
Document metadata, citations and the bibliography
3.3.2
Narrative text, structuring the document and special characters in the text
3.3.3
Code blocks
3.3.4
Cross-referencing and captioning figures
3.3.5
Cross-referencing captioning tables
3.3.6
Using inline R code to put results in the text
3.3.7
Rendering the R Markdown into an output file
3.4
Summary
4
Collecting & organising data to analyse with R
4.1
Overview
4.2
File organisation
4.2.1
Guidelines for organising your files for improved reproducibility
4.2.2
Guidelines for naming your files to improve reproducibility
4.3
Spreadsheets organisation
4.4
Cell organisation
4.5
Summary
5
Getting data into R
5.1
Overview
5.2
Getting data from spreadsheets
5.2.1
One spreadsheet file, one or more sheets
5.2.2
Mulitiple spreadsheet files
5.2.3
Importing messy spreadsheets, or when is it ok to manually edit the data?
5.3
Tabular data from non-spreadsheet programs: PDFs and Microsoft Word documents
5.4
Getting tabular data out of unstructured files
5.5
Summary
6
Preparing the data for analysis
6.1
Overview
6.2
Navigating data
6.3
Five concepts for cleaning data
6.3.1
Fixing names
6.3.2
Converting column classes
6.3.3
Splitting and combining columns
6.4
Wide and long data
6.5
Dealing with missing data
6.6
Joining data together
7
Exploring the data with visualisations
7.1
Overview
7.2
Empirical research into effective data visualisation
I Working with data
8
Analysing artefact data
8.1
Overview
8.2
Basic analysis tasks
8.3
Basic plotting tasks
8.4
Stone artefacts
8.5
Faunal remains
8.6
Pottery
8.7
Glass
9
compositional, PCA, CA
9.1
Metal
10
shapes?
II Working with data
11
Working with stratigraphic data from archaeological excavations
11.1
Overview
11.2
Visualising excavation data
11.3
Stratigraphic analysis
11.4
Particle size analysis
III Working with data
12
Spatial data and maps
12.1
Overview
12.2
Making maps
12.3
Doing spatial analysis
12.4
Published with bookdown
Archaeological Science with R
Chapter 9
compositional, PCA, CA
9.1
Metal