You need to have Git installed on your computer, and have a GitHub account. You can use command line Git or RStudio itself to push, pull, etc. to/from GitHub. See Seminar 1 for an illustrated setup guide and illustration of the full workflow from accepting an assignment to submission.
Accept: Click on the assignment invitation link for the assignment in Canvas. Each individual assignment/deliverable will have its own link, whereas the group project will only have one link at the start of the project (all deliverables will use the same shared repository). After you accept the assignment, a GitHub repository will be automatically be generated for you.
Clone the repository to your local machine (see Seminar 1 for illustration of this workflow). Now you can begin working on your submission files locally. See below for more detail on repositories and organizing files.
Follow these steps carefully, and be sure they are complete before the deadline of each deliverable. Important Note: the deadline is automated, so you will not be able to perform a late submission (even by one second). Make sure to allow plenty of time for submission!
Please include a link to your assignment repository at the top of your main output file.
Save all the files associated with your solution locally (i.e. for coding assignments R Markdown, GitHub Markdown, and any associated output files - see below for more detail).
Commit those files to your local Git repository.
Push the current state of your local repo to your private repo on GitHub. Double check that this was successful, by viewing your repo on GitHub to verify that the most recent commits are visible.
Submit the repository on Gradescope via the link in Canvas.
That’s it! You can commit/push to update your assignment as often as you’d like before the deadline (frequent commits are actually encouraged). A snapshot of your repo at the deadline will automatically be captured for grading.
If you’re concerned that something hasn’t gone right with the submission and the deadline is imminent, send the TAs an e-mail with your assignment attached. Note: this is only a last-minute emergency back-up plan, and penalties may apply. We will work with you until you get it submitted via GitHub/Gradescope.
STAT540-UBC-2024/seminar-01-yourGitHubID
will contain your Seminar 1 deliverable). Do not use additional branches or any other repositories to submit your course work.README.md
file with a clear description. These are like each assignment’s landing page.In general for coding assignments, you need to commit and push your R Markdown, GitHub Markdown, and any associated figure/output files with your assignments (note: you should not to commit raw data to your repository - see below). Writing assignments are the exception (e.g. paper critique, project proposal): a Markdown file sufficient.
This workflow is specific to STAT 540 and may not necessarily reflect your workflow in other contexts.
.Rmd
..md
).
output: github_document
as shown below---
title: "Homework assignment"
author: "Your Name"
output: github_document
---
.Rmd
are placed into a subdirectory titled [filename]_files
where [filename]
is the basename (without extension) of your .Rmd
file.Locally, you may keep input data files in some logical place within the assignment’s directory. But list the names of such data files in your top-level .gitignore
file, so that Git ignores it. Or better yet, include commands that download the data directly (if available and not too large). This is to reduce storage required on GitHub and when the TAs download your repositories for marking.
Start early. Even if you are already fluent with all the seminar materials, it will still take time to answer all the questions, and prepare files for submission.
Commit early; commit often (and push). It’s helpful to have an earlier version of your work to return to (e.g. to debug if something suddenly throws an error and you can’t figure out why 🤯, or if your cat walks on your keyboard and deletes your repo 🤷).
When you get stuck or when you run into an error, ask yourself these questions:
?function_name()
where function_name is the name of the function, to check if you’re using it right)Your Rmarkdown can’t be knitted? Is it because you didn’t define all the variables inside your Rmarkdown? Your code chunk might run in RStudio if all the variables are all defined in the RStudio environment, but it wouldn’t run as the Rmarkdown is being knitted if the variables aren’t defined in the Rmarkdown document.
Overall presentation and mechanics refer to the fluency, neatness, easiness to read. For example:
# What I did here
kable()
function from knitr
package)You might find cheatsheets from Rstudio useful, in terms of graphing, making an awesome R markdown, etc.
Make it easy for others to run your code