NNMK17004U Introduction to Ecological Data Analysis with R (REcoStat)

Volume 2019/2020

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.

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.

Academic qualifications equivalent to a BSc degree is recommended.
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.
  • Category
  • Hours
  • Colloquia
  • 7
  • Lectures
  • 21
  • Practical exercises
  • 28
  • Preparation
  • 115
  • Project work
  • 35
  • Total
  • 206
Continuous feedback during the course of the semester
Peer feedback (Students give each other feedback)
7,5 ECTS
Type of assessment
Written examination, 2 hours under invigilation
The course has been selected for ITX exam on Peter Bangs Vej.
Exam registration requirements

To be admitted to the exam students must have delivered 3-4 of the course assignments and they must have attended at least 80% of the classes.

All aids allowed

The University will make computers and power available to students taking written exams with invigilation in the University’s building on Peter Bangs Vej 36 (ITX). Students are therefore not permitted to bring their own computers, tablets or mobile phones. If textbooks and/or notes are permitted, according to the course description, these must be in paper format or on a USB flash drive.

Marking scale
passed/not passed
Censorship form
No external censorship
Several internal examiners

If ten or fewer students have registered for re-exam, the exam form will changed to oral exam.

If the requirements for participating in the exam is not fulfilled before the exam the student should hand in a report detailing an independent data analysis of an ecological dataset in R, presented in RMarkdown with figures and a discussion of key assumptions. The volume of the report should correspond to ~5 A4 pages. The report should be handed in no later than three weeks before the exam. This report may not be part of the exam.


Criteria for exam assesment

See learning outcomes.