Introduction to Ecological Data Analysis with R(REcoStat)

Course content

A good working knowledge of statistical data analysis and visualization is fundamental for most job functions within ecology, including conservation planning, environmental assessments or scientific research. It is also a necessary basis for being able to do analytical or field-based MSc thesis projects. This course aims at giving biology students the tools to perform independent data analysis for projects in ecology, and to understand and critically debate statistical data analysis from published reports and scientific papers. The main tool used in the course is the scientific programming language R, which is the de facto standard for ecological data analysis. The format mixes lectures and discussions with group exercises, and the students will work independently on data analysis projects to build the competence to do independent data analysis projects.

Learning outcome


After completion of the course, the students are expected to be able to:

  • Work independently to perform statistical analyses in ecology, including identifying scientific hypotheses and recognizing the statistical approach most suitable for testing them. This includes understanding the biological background and significance of different statistical tests and outcomes.
  • Critically debate and replicate published analyses, both in published research papers and in reports addressing ecological questions of importance to nature management.
  • Identify and acquire the necessary knowledge to conduct novel types of analysis.



  • use R to load data sets and do basic data analysis tasks

  • create custom functions and program simple simulations

  • use the R documentation to find solutions for coding problems

  • produce informative publication-quality figures, such as scatter plots, histograms and bar plots

  • test and summarize statistical models of ecological data

  • identify the assumptions of statistical tests and test if they are met

  • use standard linear regression, and derived techniques, such as spatial linear models, generalized linear models with different error families, phylogenetic regression, and random effects.

  • use the Rmarkdown syntax to produce a lab log of the analytical processes in a statistical analysis


  • After completing the course, the students should be able to describe the basic elements of the R programming language and know the basic structure of academic programming languages.
  • They should be familiar with the statistical methods available for analysis of observational data. In particular the students should be able to describe the issue of pseudoreplication and autocorrelation and detail the possible methods to deal with it.
  • Finally, the students should know functions implemented in the R packages vegan for community ecological data analysis, nodiv and ape for working with macroecological data with phylogenetic trees, sp and raster for spatial data, ggplot2 for data visualization and dplyr for manipulation of data sets.

The teaching will consist of class-room teaching that blends lectures with practical exercises. The practical exercises will be supplemented with discussions of analyses and discussions of published analyses in reports and published papers. Three times during the course, the students will work in groups to prepare a lab report detailing a statistical data analysis, written in Rmarkdown.

Handouts at the course

The students are assumed to be familiar with basic statistical terms, such as variance, mean, normal distribution, common linear regression, significance and hypothesis testing, but these terms are also introduced at the beginning of the course. No previous experience with R or statistical software is assumed. Students familiar with R must expect to experience some repetition, as this constitutes an important element in the course.

Continuous feedback during the course of the semester
Peer feedback (Students give each other feedback)
7,5 ECTS
Type of assessment
Continuous assessment
Assesment based on 3-4 reports made during the course. The assesment is based on an overall assesment.
All aids allowed
Marking scale
passed/not passed
Censorship form
No external censorship
Several internal examiners
Criteria for exam assessment

See learning outcomes.

Single subject courses (day)

  • Category
  • Hours
  • Preparation
  • 115
  • Lectures
  • 21
  • Practical exercises
  • 28
  • Colloquia
  • 7
  • Project work
  • 35
  • English
  • 206