This document is intended for teachers introducing students in archaeology to scientific programming with R and to some principles of reproducible science. It presents the basics for a class syllabus, using the archeoViz application as a pedagogical resource.
- Concepts: scientific programming, R language, Reproducible science.
- Audience: intermediate, advanced.
- Material:
- a computer with an internet connection,
- R and R Studio.
Basics of R Language
- Install and load the archeoViz package (introduction to CRAN and the following functions:
install.packages()
,library()
). - Download the Cassenade dataset.
- Load the dataset in R (functions:
read.csv()
,read.table()
,<-
) - Data edition:
- convert the coordinates values to centimetres (functions:
*
,$
) - subset (columns and rows selection; functions: indexing with
[,]
):- remove the “spitid” column,
- keep only the objects excavated in 2013.
- convert the coordinates values to centimetres (functions:
- Launch archeoViz with the edited dataset (function:
archeoViz()
) and explore it.
Reproducible Research
- If the raw table changes, the script we have written so far enables us to edit it quickly and seamlessly.
- However, what about the operations made through the archeoViz graphic interface?
- The results of the manipulation made through the graphic interface can be shared as figures and HTML files (cf. the tutorial on visualisation).
- archeoViz includes an additional feature for reproducible science: explore the “Reproducibility” tab:
- What does this tab offer?
- Examine the parameters: what type of data is represented? (variable types: character, integer, logical; functions:
c()
).
Functions and Parameters
- After interacting with the archeoViz interface, copy-paste the function in the “Reproducibility” tab in R Studio and execute it.
- Read the about the
archeoViz()
parameters. - Edit the function’s parameters to:
- display only lithic objects,
- disable data export as HTML and CSV files,
- change the title and homepage contents.
Reading
- Baxter, M. 2015. Notes on Quantitative Archaeology and R, online.
Carlson D. 2017. Quantitative Methods in Archaeology Using R, Cambridge: Cambridge University Press. DOI: 10.1017/9781139628730. - Marwick, B. CRAN Task View: Archaeological Science.
- Nakoinz, O., D. Knitter. 2016. Modelling Human Behaviour in Landscapes. Basic Concepts and Modelling Elements. Springer. DOI: 10.1007/978-3-319-29538-1.
- Special Interest Group on Scientific Scripting Languages in Archaeology, “The Didactic Map of Computational Archaeology”.
OpenEdition vous propose de citer ce billet de la manière suivante :
Sébastien Plutniak (10 juillet 2023). Introduction to the R Programming Language and Reproducible Science, using the archeoViz Application. archeoViz. Data visualization in archaeology. Consulté le 12 novembre 2024 à l’adresse https://doi.org/10.58079/bd7k