2 Pre-project Exercise
If you have completed the Setup, you are ready to start the Pre-project Exercise. If you haven’t, you’re not. Go back and complete it before you proceed.
The Pre-project Exercise has one real purpose and that is to get you and your computer ready for the Main Project. Successful completion entails:
- Installing the required R packages
- Setting up the required directory structure on your computer
- Learning how to “knit” an R Markdown (
.Rmd) file to an HTML slide deck - Understanding how (and why we need you) to save the HTML deck into the required PDF format
Do not treat this exercise as a mere nuisance. It counts for 5% of your Project score.
The Pre-project Exercise is scored all-or-nothing; there is no partial credit. You will receive full credit if and only if your content is correct and the slide deck is 100% format compliant as shown in pre_project_knitted_template.html. Take the formatting condition seriously – any deviation will result in no credit.
2.1 The exercise deliverable
The Pre-project Exercise deliverable is a 3-slide deck, submitted as a PDF, that reads the March 2024 CPS and replicates the labor force participation rate (LFPR) and its components for that month. The deck includes:
- A title slide
- A slide that reads a CSV file and prints its contents
- A slide that describes the contents of the CSV file in a paragraph using the correct values from the CSV.
That’s it. Three slides.
2.2 The workflow that produces the deliverable
Follow these steps in order to produce the slide deck:
Step 1: Open the Project in RStudio
Double-click
Project.Rprojin yourBUSN 5000/Project/folder. RStudio opens with the project loaded. You should see “Project” in the top-right corner of the RStudio window.Step 2: Open and run the Pre-project script
LF.RLF.Rreads the raw CPS data file (pppub24.csv), computes the LFPR for March 2024 and its components, and writes the results toout/LF.csv. The script is complete; do not make any edits. To run the script:- Go to the Files tab in the bottom-right pane of RStudio.
- Click the
r/folder. - Click
LF.Rto open it in the editor. - In the editor, select all lines using Ctrl+A on Windows or Cmd+A on a Mac.
- Click the Run button in the top-right of the editor pane.
If the script successfully runs, you should see the message
March 2024 LFPR = 62.7...and the fileLF.csvshould appear in theout/subfolder.Step 3: Open and edit the Pre-project R Markdown template
Go to the Files tab in the bottom-right pane of RStudio, move up to the main
Project/folder and clickpre_project.Rmdto open it in the editor.The first (title) slide is generated by the YAML (which stands for YAML Ain’t a Markup Language) block, set off by the
---markers. Slides two and three are delineated by the##headers, the second slide starting with “ReadLF.csvand print its contents” and the third with “Document the contents ofLF.csv.”The only edit to make in the YAML block is to the
authorline. Replacefirstname lastnamewith your first and last name like this:author: "Jane Doe"Do not change anything else in the YAML. If your YAML becomes corrupted, here is the definitive code block to replace your corrupted version.
--- title: "BUSN 5000 :: Pre-Project Exercise" subtitle: Measuring Labor Force Participation author: "First Name Last Name" date: | | Summer 2026 | (updated `r format(Sys.time(), '%d %b %y')`) output: ioslides_presentation: css: css/project_slidedeck.css widescreen: false urlcolor: "#004E60" # Use hex code for Olympic blue from visual UGA guide ---Just below the YAML is the setup chunk, which is complete and requires no edits. It loads the required R packages and sets global options for the rest of the document. Do not touch this.
The second slide of the template contains a small R code chunk marked by three backticks on the first and last lines:
lf <- read_csv(here("out", "LF.csv")) print(__)The first line reads the file
LF.csv(generated byLF.R) and stores it in a data frame calledlf. The second line contains aprintcommand that you must complete by replacing the blank__with the name of the object you want to print, like this:lf <- read_csv(here("out", "LF.csv")) print(lf)Run the chunk by clicking the small green play button at the top-right of the chunk. If there are no errors, the
lfdata frame contents will be printed in the console — six columns namedE,U,LF,NILF,Pop, andLFPR, with one row of numbers.When the chunk runs successfully, change the chunk option
eval = FALSEtoeval = TRUEat the top of the chunk. This tells R Markdown to run the chunk when you knit. We set it toFALSEby default so the template knits before you complete it.The third slide is a descriptive paragraph with six blanks serving as placeholders for the LFPR and its components as defined in
LF.R. Replace each blank with the appropriate value from the second slide’s output.Step 4: Knit
pre_project.Rmdto an HTML slide deck and save it as a PDFClick the Knit button at the top of the editor pane. If there are no errors,
pre_project.htmlwill appear in yourProject/folder and RStudio will open it automatically in its viewer or your browser. The Submission chapter shows exactly what pre-project slide deck should look like when rendered correctly. Compare yours with the benchmark before saving and submitting.Unfortunately, Gradescope does not accept HTML files, so you must save the HTML as a PDF. Do not knit directly to PDF; that will not produce the correct format. Instead, use your browser’s Save As / Print to PDF function to save the HTML output as a PDF. See the Submission chapter for the exact procedure and browser-specific tips.
2.3 Avoid these mistakes
The most common errors we see in attempts of the Pre-project Exercise are:
Leaving
eval = FALSEafter completing the code chunk. Ifeval = FALSE, the chunk doesn’t run when you knit, so the output doesn’t appear on the slide. Set it toTRUEonce your code is correct.Values in the third slide paragraph don’t match those in
LF.csv. This usually means a student made a transcription error or used a source different from the output ofLF.R.YAML edits beyond the author line. Changing anything in the YAML besides the author name will break the knit format. Don’t touch the
title,subtitle,date,output,css, or any other field.CSS file not correctly placed. If
project_slidedeck.cssis anywhere other thanProject/css/, the knit produces an unstyled output that won’t match the template.
When in doubt, see Common Errors, which provides a comprehensive listing of errors we’ve seen students make.
2.4 What happens next
After successfully completing the Pre-project Exercise, you are ready to begin work on the Main Project. The Main Project template will be downloaded to Project/ folder and you will follow the same workflow outlined here.