Introduction to R for ecology and evolutionary biology

  • Lecturer(s) or Responsible(s): Vitor Sousa (cE3c); Inês Fragata (IGC)
  • Department Responsible: Departamento de Biologia Animal (FCUL)
  • Data: February 11th, 2019 to February 15th, 2019
  • Deadline for Applications: January 4th, 2019
  • Duration: 36 hours
  • Schedule: 9h-12h30 and 14h-17h30, Monday-Thursday; 9h-13h and 14h-18h Friday
  • Nº (min, max) Students: 10-20
  • Location: Departamento de Biologia Animal, Faculdade de Ciências da Universidade de Lisboa


  •          Introduction to R variables, data types and graphical output
  •          Simulate evolution of populations
  •          Exploratory analysis for ecology and evolution (PCA, MDS, etc.)
  •          Linear regression, ANOVA and hypothesis testing using resampling techniques (bootstrap, permutations, etc.)
  •          Bayesian statistics: advanced inference algorithms (Markov chain Monte Carlo)
  •          Student’s case studies.

Throughout the course, students will be encouraged to apply the knowledge obtained to data from their own work. Depending on the interests of the participants some of the content can be adjusted to focus more on examples from evolutionary biology or from ecology. On the last day, each student will do a small presentation with data available from their own work, or with possible applications to their research question.

This course can have a recognition of 6 ECTs for FCUL PhD students enrolling in it as part of their first doctoral year. For FCUL PhD students only requiring 5 ECTs recognized in their specific PhD programmes the last 6 hours of the course are not mandatory and the certificate will be on 'Topics in R without fear’.

Minimum formation: Basic knowledge in R and Rstudio. A tutorial will be provided to be done before the course.



Directed to: PhD or MSc students in Biology, Evolution, Ecology or related areas, and postdocs and other professionals working in related topics

General Plan

- Introduction to R syntax and basic commands. The aim is that students become familiar with different types of variables and learn how to manipulate variables and perform basic plots.

- Introduction to exploratory data analyses. The students will learn how to perform and interpret the results of Principal Component Analyses (PCA) and Multivariate Evolutionary Analyses.

- Hypotheses testing using resampling approaches (e.g. bootstrap and jackknife). Many datasets in ecology and evolution violate assumptions of classical statistical tests, and hence resampling approaches became common practice. Students will learn how to perform hypothesis testing using permutation tests, bootstrap and jackknife.

- General linear models and ANOVA models (factorial and nested ANOVA). Students will learn how to perform and interpret results from general linear models.

- Simulating dynamic systems and modelling in R. We will use examples from population genetics (genetic drift and coalescent gene trees) and population dynamics (Lotka-Volterra predator-prey model) to illustrate how R can be used to perform simulations. The students will learn how to model and perform simulations of populations evolving through time. Introduction to R programming using flow control, for loops, if statements and samples of random values from distributions, etc.

- Introduction to Bayesian statistics. The students will learn how to use a Markov chain Monte Carlo (MCMC) algorithm to estimate parameters of different models of population dynamics.

- Student’s case studies.


Students fees.




Free for 1st year PhD students in the Doctoral program in Biology (FCUL), Biodiversity, Genetics and Evolution (BIODIV UL; UP) and Biology and Ecology of Global Changes (BEAG UL, UA) when the course counts credits for their formation, in which case the delivery of a final report done after the course is mandatory; 50 € for more advanced PhD students of cE3c; 80 € for PhD students of the PEERS network (CFE); 125 € for FCUL Master students and unemployed; 180 € for BTI, BI and other PhD students; 250 € for Professional and postdocs.

When the maximum number of students is reached 10 vacancies will be available for non-paying 1st year PhD students mentioned above, being, by order of preference: 1) cE3c students; 2) BIODIV students (not from cE3c); 3) FCUL students (not from cE3c); 4) BEAG students (not from FCUL).

Contacts for Inscription

Candidates should send a short CV and a motivation letter to Vitor Sousa ( and Inês Fragata ( The cv and letter should be named as 1st-lastNAME-CV.pdf and 1st-lastNAME-ML.pdf (that is personalize the name of each file with your first and last name).


In the email please add the following information:


Full Name:________________________






Professional activity: Professional/Postdoc, BTI, BI (or other non-post-doc research grant), PhD student (with/ without scholarship), Lic. (Bachelor)/Master student______________________


Academic formation:____________________


PhD student of the 1st year of Doctoral programme BIODIV (FCUL/FCUP), Biologia (FCUL) or BEAG (FCUL or UA)?:____


If yes to the above question, PhD student doing the Course to count credits for 1st year?:_____


PhD student of cE3c or CEF (Centro de Ecologia Funcional):?_____


If PhD student from another programme/centre, which:________________