Support Options

  • Knowledge Base

    Find information on common questions and issues.

  • Support Messages

    Check on the status of your correspondences with members of the QUBES team.

Contact Us

About you
About the problem

An introduction to population matrix models: a swirl lesson

By Jennifer Apple

SUNY Geneseo

Students will learn how to set up a population matrix model in R and use it for demographic analysis of a population, including projecting population growth, determining lambda and the stable age distribution, and conducting an elasticity analysis.

Listed in Teaching Materials | resource by group Make Teaching with R in Undergraduate Biology Less Excruciating 2020

Version 1.0 - published on 15 Jun 2020 doi:10.25334/X2D5-YG13 - cite this

Licensed under CC Attribution-ShareAlike 4.0 International according to these terms

matrix icon square.jpg


In this exercise students learn how to build a population matrix model in R to represent demographic parameters for a population and perform demographic analyses using the R package ‘popbio.’ Two swirl lessons guide students through setting up the matrix and analysis using the matrix model. After completing these swirl lessons, students should be able to:

  • develop a population matrix model in R
  • understand the components of a population matrix model
  • use a population matrix model to project population size in the future
  • estimate lambda and determine the stable age distribution
  • interpret the values from an elasticity analysis

This exercise was developed for an introductory ecology course typically taken by sophomores. Students should have some familiarity with R. Students taking the swirl course should also be given the supplied pdf file, “An introduction to using population matrix models in R,” which provides background information and some of the R code they will need. Powerpoint slides to introduce matrix models are also provided. This swirl course could be completed within a 50-minute class period by most students, if necessary background on population growth and matrix models is provided in advance and the course is installed via RStudio before the class period. Separate instructions to guide students through the process of installing swirl and the course file are provided. Students could also complete the swirl lessons outside of class time or in an online-only course.


Cite this work


Relation to series

The resource is part of the series below:

  • Answer Checking

    This activity provides students with a set of strategies they can use to check their own answers in their biology and other courses. Students practice the answer checking strategies on a series of simple examples.

Make Teaching with R in Undergraduate Biology Less Excruciating 2020

When watching a resource, you will be notified when a new version is released.