-
Notifications
You must be signed in to change notification settings - Fork 11
Courseware
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.
Visit Posit software and download R and RStudio. If you already have them installed, please do this update anyway.
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.
With your browser, visit https://github.com/BigelowLab/ColbyForecasting2025 and create your own fork of the repository.
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.)
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.
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.
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?
Back in Rstudio
, in the “Console” pane type the following.
source("setup.R")
If running source("setup.R")
is problematic, you may need to update or
install your
RTools.
RTools are Windows-specific utilities.
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.
Last but not least please install quarto