Welcome Requirements General Instructions Lab Community Forum

Welcome

This website contains the lab exercises for the MSU Graduate course: Spatial Ecology (IBIO870; cross-listed FW/FOR), Fall 2025. Labs will be posted through the semester. The labs are generally mixtures of background, code with descriptive text, and results. Most labs have exercises for you to produce working code and output, such as plots, and will require R and RStudio. Please read the instructions under “Lab” on D2L, and on the Syllabus. These contain due dates, how to submit your Lab assignments, and expectations. If you are coming to this website and are not enrolled in the course, feel free to try out the exercises.

Please note that this website was updated from a previous version of the class. If you see any broken links or inaccurate text/code, please let us know so that we can fix it!

Heads up
If you see broken links or inaccurate text/code, please let us know so we can fix it!

Requirements

  • Install R and and the “Open Source Edition” of Rstudio desktop (both free) on your computer. For more information on installing those programs, see the R section in the Resources tab on D2L, this Data Carpentries Lesson, or the MSU SpaCE Lab’s guide,
Installation note
You may safely use all the defaults options during these installations.
  • Some of the scripts use relative file paths to load in data. It will be helpful to replicate the folder (directory) structure for Labs on your computer as follows:

    • Create a folder for this course (something like ‘SpatialEcologyLab’). This is your working directory.

    • In your course folder, create a ‘data’ folder that will be used by some labs. Within this folder, add folders (subdirectories) for each lab in all lowercase, before starting a lab. For example, create ‘lab1’ before you work on lab1.

  • Place the .R or .Rmd files for each lab in your working directory and work from that directory.

General Instructions

The labs provide example code that you can use to complete the exercises. You may copy/paste this code into your own scripts or start from the source code (see R Markdown below).

Most labs use data pulled from the internet, and usually with R code to do that downloading automatically. In the event that you cannot download these data from the internet, they are also linked on this page, or in the lab text itself.

R Markdown

Lab 2 describes how to write code so that you can create a report in a format called “Markdown”, or a format specific to R called “RMarkdown.” For all lab assignments starting with Lab 2, you will write RMarkdown files that you’ll use RStudio to run and create a PDF. The PDF includes your write-up, your code, and the outputs from your code (text, plots, images, etc). You turn in this PDF for credit.

The lab documents themselves were written in RMarkdown, and used R to run all the code, create the plots, and then create this website to make it easy to read. To help you get started on your exercise, you can also download these RMarkdown scripts and run them on your own computer to see how they work, or to use them to start working on your Lab assignment.

Each lab will have a link at the top to the “source code” for the lab (in “RMarkdown format” or Rmd). Lab 2 contains more information about RMarkdown and how to use it.

Data

A few labs need other files to be complete, and if these are necessary they will also have links to them. However all the data used by all of the labs is available in the “data” folder on GitHub.

GitHub

I don’t expect you to be familiar with git or GitHub (which you may have heard of) but this is a convenient way to make all of the R source code and data files available to you. We will go over an introduction to GitHub in a future Lab.

Lab Community Forum

Please see the Syllabus and D2L for a full description of the Lab Community Forum. The Lab Community Forum is a collection of discussion topics on D2L, one for each Lab. Further instructions are found at the top of each Lab Community Forum Google Doc. Remember that even if you don’t have a question to post to the Lab Community Forum, you can add in some helpful tips you came across while using R that relate to the Lab. Participation in this course includes contributions to this Forum.

Creative Commons License
This work is licensed under a Licensed under CC-BY 4.0 2025; Website created by Phoebe Zarnetske.

Website last updated 2025-08-19.