Skip to content

Courseware

Ben Tupper edited this page Jan 10, 2025 · 6 revisions

Courseware

Github account

We’ll be using git software version control and github coding platform for archiving and sharing code developed for this course. Make a github account if you don’t have one already; it’s free and you may find you use it for other classes or even professionally.

Install R and RStudio

Visit Posit software and download R and RStudio. If you already have them installed, please do this update anyway.

Set up RStudio/R to work with git

Happy git with R is a hands-on tutorial on how to set up git with your installation of RStudio/R. Pay close attention to this page. Once you have this set up it works seamlessly. You will face a choice between using https with a personal access token (PAT) or setting up ssh keys. Each provides a very secure way to access your github account without resorting to security-feeble passwords, and each has its own advantages. Unless you have already exchanged ssh keys with github we strongly suggest that you use a PAT.

Store your PAT like you would any password - secure to you and nobody else.

Fork the courseware repository

With your browser, visit https://github.com/BigelowLab/ColbyForecasting2025 and create your own fork of the repository.

Create a new project on your own computer

You’ll be creating a new project folder on your own computer that holds an exact copy of your newly created fork. You’ll need to know the URL of your newly created fork… it will look something like https://github.com/my_github_name/ColbyForecasting2025. Be sure you are not using Bigelow’s repository URL.

Start RStudio/R and use the File > New Project... > Version Control menu choices. You will be asked for 3 items: repository URL, a name for the project directory (we suggest “ColbyForecasting2025”), and the location on your computer where you would like to store the project directory (such as your home or documents directory.)

Fetch the data

We have stored the data in a compressed file stored on at any one of the three links belwo, download and unpack the directory. Do not place the data directory in your project folder. We suggest that you place it “next” to your project directory.

Use any one of the three links below to download the data.

Configure your setup.

Quite RStudio and start up a fresh session. Select the menu option File > Open project and select the project you just created. In the Files double click the “setup.R” file. Edit the value of the variable ROOT_DATA_PATH which is the last line of the file. You should put in the path description for your recently downloaded and unpacked data directory. Save the file after making the edit.

Check your git status

If you have successfully edited, check out the Git panel. Note the git has detected a change in your repository. Check the box next to the file, and then select the “Commit” button. In the dialog add a commit message, like “changed ROOT_DATA_PATH to my personal workspace” - some kind of a note to future yourself. Then select the “Commit” button. Next select the “Push” option at upper right. If that is successful it will be hard to tell. You’ll know if isn’t successful because you will get alarming but harmless messages.

Navigate your browser to your own github account, and inspect the repository stored with github. Does it reflect your changes?

Run the setup

Back in Rstudio, in the “Console” pane type the following.

source("setup.R")

Windows users note

If running source("setup.R") is problematic, you may need to update or install your RTools. RTools are Windows-specific utilities.

macos users note

You may discover that you need to update your X windowing software (this is the window system for the unix-y side of your OS). If so download and install from xquartz.org.

Install quarto

Last but not least please install quarto