Chapter 2 Importing Data

All of the Itrax data is in either text-format or “tagged image format” (*.tif). Although this means it is easily read by the various import functions available in R, it still needs considerable cleaning and wrangling to get it to a point where it is usable for most analyses. There are three possible approaches to this task:

  1. Use existing functions published in the itraxR package available from github.com/tombishop1/itraxR. These are at an early stage and functionality might be broken, but are largely convenience functions for wrangling and analysing Itrax data. It is easy to install the package directly from Github using remotes::install_github("tombishop1/itraxR").
  2. Work in base R to wrangle the data. This is perfectly achievable, and much of the current itraxR functionality was originally written this way.
  3. Work in the tidyverse family of packages and style. For data wrangling tasks, this approach can result in simpler and more resilient code.

In this guide examples will be given using the functions provided in itraxR, but the processes used in those functions will be explained, and the code used in those functions is fully commented so can be modified to suit particular needs.