Preparing and Submitting Your Assignment — Cheatsheet
This is a one-page quick reference for preparing and submitting a BIOL 202 assignment. For full explanations, see Tutorial 3, Preparing and formatting assignments.
1. Before you open the assignment file
- Open your
BIOL202_assignmentsRStudio project (double-click the.Rprojfile) — don’t just open the.Rmdon its own. (Tutorial 3, §3.1.1; Tutorial 2, §2.4.1) - Confirm you’re in the right project: bottom-right Files pane should show your assignment files, top-right corner of RStudio should name the project.
- Download the assignment
.Rmdfrom Canvas → Assignments (or theLab_materialsmodule for the practice assignment) and save it into yourBIOL202_assignmentsroot or the assignment’s subfolder. (Tutorial 3, §3.1.2)
2. Set up the header — do this first, change nothing else
- Open the
.Rmd. In the header block only, replace: assignment title,Firstname Lastname, Section YY, and due date — keep the quotation marks. (Tutorial 3, §3.1.3) - Do not touch anything else in the header or the R chunk immediately below it.
- Immediately Save As with your proper file name, e.g.
Pither_BIOL202_lab-assignment-01.Rmd(no version number needed if the file lives in OneDrive — OneDrive keeps old versions for you). (Tutorial 3, §3.1.3; Tutorial 2, §2.2.1)
3. Load packages once, near the top
- One chunk near the top loads what you’ll need — one
library()line per package (neverlibrary(tidyverse)):library(dplyr),library(ggplot2),library(readr),library(biol202)— add others only if a question needs them. (Tutorial 3, §3.2; Tutorial 1, §1.3.5) - Never put
install.packages()inside the.Rmd— install in the Console only. (Tutorial 1, §1.3.4)
4. Answer each question
- Load each dataset with
library(biol202); data(name), orread_csv()if the question says to import a CSV. (Tutorial 3, §3.2.2; Tutorial 4, §4.4) - Answer in full sentences, addressing exactly what’s asked.
- Every answer’s code sits in its own R chunk, with a unique chunk name. (Tutorial 3, §3.2.1)
- Press the green ▶ to run each chunk as you go — don’t wait until the end. (Tutorial 3, §3.2)
- If a chunk produces a lot of clutter (e.g. package-loading messages), add
message = FALSEto that chunk’s header only — not by default. (Tutorial 3, §3.2.1) - Save and knit often — don’t wait until you’re finished to knit for the first time. (Tutorial 3, §3.2)
5. Figures
- Every chunk that makes a plot needs
fig.cap = "...",fig.width =,fig.height =in its header, with a blank line before the plotting code starts. (Tutorial 3, §3.3) - Leave a blank line between the end of a figure chunk and the text below it, or the caption won’t appear. (Common Issues)
- If you use a graph to answer a question, refer to it by name/number in your written answer. (Tutorial 3, §3.2)
- Figure numbers (“Figure 1:”, “Figure 2:”…) are automatic — don’t type them yourself.
6. Knit to PDF
- Click the Knit dropdown → Knit to PDF (don’t just click “Knit” without checking it says PDF). (Tutorial 3, §3.5; Tutorial 1, §1.5.2)
- The PDF takes the same name as your
.Rmd, just with a.pdfextension.
If knitting fails, check the error against these first (all from the Common Issues page)
| Error says… | Likely fix |
|---|---|
could not find function |
You used a package function before library() loaded it — load it in a chunk near the top. Details |
there is no package called... |
Package isn’t installed — run install.packages() in the Console, not the .Rmd. Details |
trying to use CRAN without setting a mirror |
You have install.packages() inside the .Rmd — remove it, install in Console instead. Details |
LaTeX failed / pdflatex not found |
Run in Console: install.packages("tinytex") then tinytex::install_tinytex(). Details |
| Mentions a Unicode character | You likely pasted text from the web (curly quotes, special symbols). Retype the offending text. Details |
unused argument |
A library() call is below the chunk that uses it — move library() above. Details |
object not found |
You’re using an object before creating it — create it in an earlier chunk. Details |
| Parse/syntax error, points to a line | Look for a stray symbol (comma, bracket, >) on that line. Details |
| Still stuck | Google the exact error text + “R”; read which line R points to first. Details |
7. Check the PDF before submitting
- Open the knitted PDF and read it start to finish.
- Every question has code, output, and a written answer — nothing missing or cut off.
- Figures render properly and each has a caption starting “Figure X:”.
- Spelling and grammar check.
- If anything’s wrong: close the PDF, fix the
.Rmd, save, then re-knit — never hand-edit the PDF. (Tutorial 3, §3.5)
8. Name your files and submit
- Confirm both files share the same base name, e.g.
Pither_BIOL202_lab-assignment-01.Rmdand.pdf— follow the naming convention given with the specific assignment. - Upload both the
.Rmdand the.pdfto the assignment’s Canvas submission page. (Tutorial 3, §3.6) - After uploading, re-open the submission on Canvas and confirm the PDF opens correctly and is the right version.