1 Prerequisites

For this R primer, you’ll need to read several chapters of Soetaert and Herman (2009) which are available on the Canvas website. Their book is an excellent source for those interested in ecosystem modeling, especially in aquatic systems. We will use bits of it along with this online text to get a little more comfortable with ecosystem processes and models.

I also assume that you are reading a book on ecosystem ecology such as Chapin III, Matson, and Mooney (2011).

1.1 Must do’s

Read background material as needed.

  • Install or update R (v. 4.2.2, as of 2022 January)
  • Install or update RStudio (v. 2022.12.0+353, as of 2022 January)
  • Install or update selected R packages: ‘deSolve’, ‘tidyverse’, ‘LakeMetabolizer`, ’lubridate’, ‘googlesheets4’. (tidyverse is a collection of packages)

Also, before doing most tasks in this primer, load deSolve and tidyverse with library(deSolve); library(tidyverse).

The R working directory is the place R automatically looks for files. For simplicity, I will refer to the R working directory as Rwork. Therefore, Rwork/data would be a folder or directory called data inside Rwork. At any point in time, you can find out what your working directory is using getwd(). You can set your working directory using setwd("HD/MyStuff/Rwork"), where “HD/MyStuff/Rwork” is the path to what you want your working directory to be. You can also use the “Session” pull-down menu in RStudio.

1.2 A couple of useful citations

  1. Ten simple rules for biologists learning to program. PLoS Computional Biology 14(1): e1005871. https://doi.org/10.1371/journal.pcbi.1005871

  2. Ten simple rules for tackling your first mathematical models: A guide for graduate students by graduate students. PLOS Computational Biology 17(1): e1008539. https://doi.org/10.1371/journal.pcbi.1008539

1.3 A final suggestion

An elementary book or manual introducing a topic is called a “primer” and is pronounced like “prim”, just like the grammarian pointing this out. In contrast, a small explosion or flame that detonates a larger explosion uses the same spelling, “primer”, but is pronounced like “prime”, with a long “i” sound. Be cautious about your use of these; incorrect use could lead to unexpected consequences.

References

Chapin III, F S, P A Matson, and H A Mooney. 2011. Principles of Terrestrial Ecosystem Ecology. 2nd edition. Springer.
Soetaert, K, and P M J Herman. 2009. A Practical Guide to Ecological Modelling. Springer.