Reproducing the analyses

This manual contains code that can be copy pasted into an R script and executed to reproduce the results. In order to do so, you need to download the raw data as well as annotated twilight files used in this manual. The data need to be in a specific structure of folders and we do recommend you have a similar structure for your own analysis. During the processing of the data we save intermediate steps that allow us to step into the next analysis step without going through all initial and often time consuming parts. Having your raw data and your results in a well structured fomr, becomes especially important if you run analyses for many tags of the same or different species. It is also recommended that you create a single R script for each analysis (e.g. for each individual and each analysis using different tools). For example, you can name the R scripts using the tag id and the tool e.g. 14SA_SGAT.R. Since this manual is dealing with tags from different species, the following structure with sub-folders per speces (first three letters of the genus name and the species name) is setup within the main folder (called data):

  • RawData
    • LanCol
    • MerApi
    • PasCir
  • Results
    • LanCol
    • MerApi
    • PasCir
  • RCode
    • LanCol
    • MerApi
    • PasCir

You can download the folders with the raw data as well as the annotaded twilight files directly via R and extract into a data folder.

url <- "https://github.com/slisovski/TheGeolocationManual/raw/master/download/data.zip"

temp <- tempfile()
download.file(url, temp)
unzip(temp, exdir = "data")

We also recommend using R Studio and creating a project (File -> NewProject). Alternatively, you can set the working directory using the setwd function. With the data folder in your project folder (or more in general in your working directory) you should be able to run the code provided in this manual.

We also recommend to use R Studio and to create a project (File -> NewProject). Save the project file into the existing Data folder. This makes sure that Data is your working directory and it will remain the working directory even if the folder moves around on your drive. Alternatively, you can set the working directory using the setwd function. With the suggested folder structure and the raw data and the annotaded twiligth files you should be able to run the code provided in this manual.