Install tools

For this course you will need access to a machine with an installation of R, Git, RStudio and some important R packages, including, of course, mizer itself and mizerExperimental. Below we give the necessary information to allow you to install these tools.

If you run into difficulties, please make a post in the Comments section below. It is quite likely that someone else on the course has encountered similar difficulties and that someone has ideas on how to solve them.

If you already have some of these tools installed, please make sure that the version you have is recent.

R

Mizer is compatible with R versions 3.1 and later. However in this course we will assume that you have a version newer than 4.0. So if you are still using 3.x, now is the time to upgrade. You can install or upgrade R on your computer by following the instructions at https://cran.r-project.org/ for your particular platform. In fact, upgrading follows the same procedure as installing from scratch.

Alternatively, if you can not or do not want to install R on your computer, you can also work with R and RStudio in your internet browser by creating yourself a free account at https://rstudio.cloud. There you can then install mizer as described above. Running mizer in the RStudio Cloud may be slightly slower than running it locally on your machine, but the speed is usually quite acceptable.

RStudio

This course assumes that you will be using RStudio to work with R. There is really no reason not to use RStudio and it makes a lot of things much easier.

RStudio develops rapidly and adds useful features all the time and so it is best if you install the latest version. This course was written with version 2022.07.0+548. If you already have RStudio installed but it is an older version, the way to upgrade is to just install the newest version. The old version will automatically be replaced by the new.

If you are new to RStudio, the video on the RStudio IDE homepage is well worth watching.

R Packages

R packages extend the functionality of R. mizer itself is such an R package. There is a central repository for R packages called CRAN which hosts all of the packages needed for this course, except for the mizerExperimental and mizerMR packages. To install them on your computer just start RStudio and then in the console issue the commands

install.packages(c("tidyverse", "plotly", "remotes", "usethis",
                   "rmarkdown", "rstudioapi"))
remotes::install_version("mizer", version = "2.3.1")

The mizerExperimental package is for code that is still experimental and thus changes frequently. Therefore it is hosted in a GitHub repository. We need the package in a version that can handle multiple resources. You install it that version with

remotes::install_github("sizespectrum/mizerExperimental", ref = "tuneMR")

At this point R will offer to update some packages. In particular it will offer to update mizer to a current version. You do not want to do that but keep mizer 2.3.1 which was the version in place when this course was running.

The mizerMR package that extends mizer to work with multiple resources has not been released to CRAN because the plan is to incorporate it into core mizer in the future, so this too you need to install directly from GitHub. For this course we also specify the ref argument so that we get the package in the state it was in in August 2022.

remotes::install_github("sizespectrum/mizerMR", ref = "364972c")

Git

Caution

Now that the live version of the course has finished and you are working through the tutorials on your own, you do not need to use Git any more. But of course Git is generally a very important tool, so feel free to install it.

Git is a distributed version control system that we will use in this course. We will discuss that more on the page Use Git and GitHub.

Git may already be installed on your system. If you are in RStudio, then you can issue the following command in the “Terminal” tab:

git --version

If that comes back with a version number, then git is already installed. The current Git version is 2.25.1. If you have an older version then keep this in mind and if you should at some point notice that Git is not behaving the same for you as for others, then you might want to install the latest version. Or simply install the latest version now to be on the safe side.

To install Git follow the links at https://git-scm.com/downloads for your operating system. You do not need a GUI client for Git because you will be using Git from within RStudio. After you have installed Git, you may want to restart RStudio.

Finally, you should tell Git about yourself by running the following command in the RStudio Console, where of course you change the name and email address to your own:

usethis::use_git_config(user.name = "Jane Doe", 
                        user.email = "jane@example.org")

Issues

As with all computer-related things, unexpected problems are likely to crop up. Be sure to post about them below. Alternatively you can also report issues by clicking on the “Report an issue” link that you find at the bottom of the right side-bar. That will create an entry in the GitHub issue tracker.

If you have a correction to this page or want to suggest an edit, use the “Edit this page” link. Don’t worry: we will need to approve your edits before they go live, so you can feel free to edit as much as you like.

This course should be a collaborative experience. You will find the “Edit this page” and “Report an issue” links on every tutorial page and you will find a comments section on every page of the course website. Never hesitate to use them.