Introduction to the R Programming Language and Reproducible Science, using the archeoViz Application

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.
  • 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



Citer ce billet
Sébastien Plutniak (2023, 10 juillet). Introduction to the R Programming Language and Reproducible Science, using the archeoViz Application. archeoViz. Data visualization in archaeology. Consulté le 14 juin 2024, à l’adresse https://doi.org/10.58079/bd7k

Rechercher dans OpenEdition Search

Vous allez être redirigé vers OpenEdition Search