User Tools

Site Tools


Introduction to R for Ecologists


Every autumn since I am teaching at National Taiwan University, I run the course “Introduction to R for Ecologists” (REcol, I was also teaching a similar course before when still in Czech (Visualization of Biological Data, The original idea (from ~ 15 years ago) was to teach R using something easy to do, which does not require any statistical knowledge, so I started to teach it on plotting the figures (that's why “Visualization”). After I opened the class in Taiwan, I add more material, including also simple data analysis and data manipulation. The class name may be a bit confusing - it's not necessary just for ecologists, but I am using mostly ecological data in the class, since my professional background.

Recently, I got idea to modify this class. I feel that the focus on “teaching basic R” these days is already a bit obsolete - a lot of students actually know R before they take the class, and hope to learn something more. At the same time, I more and more stress in the class the fact that using R helps us with the research reproducibility. The fact that you are able to show others your analysis in fully reproducible R code is a great step toward transparency in science, and in recent years it starts to be more standard then exception. That's why I think about renaming the class into “Introduction to reproducible research and data manipulation in R”, and also change the structure of the course - reduce the figure plotting part, and put more weight on data manipulation and creating reproducible workflow in R.

I would be curious about the opinion of those who have taken this class before - what do you think about that? After every class I collected opinions from students using a simple poll, and I use them, if possible, to improve the class in the coming years. This time I wonder what would you suggest me if I decide for a rather radical revamp of the original class. Any suggestions welcome!

(link to the original Facebook post is here:

EEB5082 (B44U1940), semester 108-1, 3 credits, in English

When & where: Tuesday 2,3,4 (9:10-12:10), 3A Life Science building, National Taiwan University

Office hours: by appointment (if you need to consult things related to the class, just drop me an email and we will fix the time).

Instructor: David Zelený (澤大衛)

Teaching assistants: Po-Yu Lin (林柏佑) and Hsin-Yen Teng (鄧信彥)

Link to CEIBA:

Closed Facebook group: (consider joining!)

About the class

R program offers a powerful tool for analysing and visualising data, and in recent years it became very popular among ecologists (and not only them). It offers great freedom in analysing, manipulating and visualising any type of data, which is not something you can do in clickable software like SAS, SPSS or STATISTICA. However, it also comes up with a steep learning curve of S language and frustration from frequent error messages.

The goal of this practical course is to teach students basic skills of using R program, so as they can use it in analysing and visualising data from their research projects or other, more advanced courses focused on R.

The class consists mostly of practical exercises in front of the computer with running R and RStudio, with brief theoretical modules. Credits will be gained for handing homework assignments, active participation in the class, passing the midterm quiz, and delivering the final oral presentation of individual project (in English).

What to prepare for the class

  • Please, make sure to bring your own computer for the class, with access to school wifi and enought battery for three hours of work (or bring your power cable - we will provide enough electricity sockets). Any system (Windows, Mac, Linux) is ok, as far as you are able to operate it.
  • Install the latest version of R and RStudio before you come for the first class - see instructions here.
  • If you used R and RStudio before, please make sure that you updated to the version required for this class (R version 3.6.1 and RStudio version 1.2.1335 or later); instructions how to update are here.
  • It is important that we all are using the same version of programs, to avoid situation that you will get error messages just because of using outdated version of R or RStudio.

Teaching schedule (subject to changes)

  • Introduction to R and RStudio, basic operations in S language, installation of packages
  • Main types of R objects (vector, matrix, data frame, list), reading and exporting data, creating fully reproducible R script.
  • Loop and function, using the random ecological drift example.
  • How to draw effective scientific figures, high-level vs. low-level graphical functions.
  • Colors, how to choose them and draw them in R.
  • Graphical file formats, raster vs vector graphics.
  • Manipulating data (sorting, merging)
  • Functions which can loop through data.
  • Simple rules for vectorization.
  • Simple rules for parallelization of operations
  • Creating figures from scratch, practising.
  • Midterm quiz (during the midterm week)
  • Final presentations (5 minutes each, last two lectures)

Final evaluation

The final evaluation consists of four parts:

  1. Homework assignments (30%)
  2. Activity in the class, individual work (20%)
  3. Midterm quiz (20%)
  4. Final presentation (30%)
recol/start.txt · Last modified: 2020/04/05 20:57 by david