Week 4 The Theory of Natural Selection

Understanding natural selection is fundamental to properly understanding evolution. The basics of natural selection are relatively straightforward but surprisingly easily misunderstood. Our aim with this practical session is to use the R environment to actually demonstrate some models of selection and to also simulate evolution by natural selection. Thus we hope you’ll start to see how R can be useful for helping you grasp difficult theoretical concepts as well as handling data.

What to expect

In this section we will:

  • Learn about creating your own functions in R
  • recreate fitness functions in R to develop our understanding of natural selection
  • use the one-locus viability model of selection to simulate evolution
  • model overdominance and underdominance
  • continue to practice your R skills

Getting started

The first thing we need to do is set up the R environment. We won’t be using anything other than base R and the tidyverse package today. So you’ll need to load the latter.

library(tidyverse)