Reference solution for the Chapter 4 Practice Demo Lab (Tasks 1–7 of Lab: Set up a working R project together). The graded Canvas lab has its own private answer key.
Tasks 1–4 — Setup (expected outcome)
These are setup steps; the “answer” is a working project:
Posit Cloud account — each member signs in at posit.cloud.
Create the project — a project named frst232 with data/, outputs/, and R/ sub-folders.
Install packages — install.packages(c("tidyverse", "readxl", "here")) completes without error (a package is a bundle of reusable functions; there are many because each solves a focused task).
Upload the data — bc_disturbance_reforestation.xlsx sits in data/. Confirm with list.files(here("data")) — the file name should appear.
Task 5 — First import (everyone gets the same dim)
bc <-read_excel(here("data", "bc_disturbance_reforestation.xlsx"),sheet ="Data")dim(bc) # expected: 37 8
Every group member should see dim(bc) = 37 8 — 37 fiscal years, 8 columns. If someone sees something different, the usual cause is the file in the wrong folder or the wrong sheet=.
sum(bc$Reforestation_ha) = 8,264,064 ha. Everyone in the group should get this same number, and it should match the =SUM(H2:H38) total from the Chapter 1 Excel workbook — the whole point of the Excel→R transition: same data, same answer, now reproducible.
Task 7 — Submit
Submit one screenshot showing a member’s RStudio/Posit Cloud with the BC file loaded, the column names visible, and the sum() result — with all group members’ names. (Graded lab: follow Canvas.)