Environment

This section explains everything you need to set up before the first lab. It takes about an hour, most of which is waiting for software to install, so do it well before the first session.

You will need:

Choose R or Python

You can follow this course in either R or Python, depending on your past experience and preference. Choose one language and stick to it throughout the course: you will need to submit both assignments in the same language.

R Python
You install R, RStudio and the R packages for the course Miniforge and the course environment (envs363_563.yml)
You write and run code in Quarto documents (.qmd) in RStudio Jupyter Notebooks (.ipynb) in Jupyter Notebook
Set-up instructions R set-up Python set-up

Follow the set-up page for your language from start to finish. Each page ends with a check that tells you whether everything installed correctly.

Important

Don’t mix the two: don’t run Python code in RStudio, and don’t try to run the R labs in Jupyter.

Set up your course folder

Whichever language you choose, keep all your work for the course in one folder called envs363_563, with the lab data in a data folder inside it:

envs363_563/
├── data/
│   └── London/
│       └── ...
├── lab_01.qmd      (R)
└── lab_01.ipynb    (Python)

Save your .qmd or .ipynb files directly in envs363_563, next to the data folder. The labs read data with relative paths such as "data/London/Tables/...", which only work with this layout. The set-up pages for R and Python explain this in more detail.

Download the data for each lab

The data for each lab is in the course GitHub repository. Download the folder you need at the start of each lab, rather than all the data at once, so you always have the latest version. See Download data from GitHub for step-by-step instructions.

Getting help

If something goes wrong during set-up:

  1. Check the troubleshooting advice on your set-up page (the Python page has a section covering the most common problems).
  2. If you’re still stuck, post on the module’s Microsoft Teams channel. Include your operating system, the step you were on, and the full error message copied as text.

Reproducing this book

If you want to render this book yourself, rather than just follow the labs, you need:

  • a recent version of Quarto (it is bundled with recent versions of RStudio);
  • R and all the packages from the R set-up;
  • the Python course environment from the Python set-up, activated when you render, so that Quarto can run the Python chapters.