Lab Setup Instructions
Overview
Each week, you’ll complete lab assignments and add them to your portfolio website. This document explains the one-time setup process and the weekly workflow you’ll follow all semester.
One-Time Setup (Week 1 Only)
Step 0: Clone the Course Repository
You can also do this in GitHub Desktop, which will probably be easier at first, but slower in the long run. Following is the bash code.
Very Important: To follow the steps using the bash code, you need to install Git first and finish the git client setup
First, clone the course repository (you only need to do this once):
Open Terminal/Command Prompt
Navigate to where you want to store course materials:
cd ~/Desktop # or wherever you keep school foldersClone the course repository:
git clone https://github.com/[YOUR GITHUB USERNAME]/CPLN-5920-SP26.git
Important: This creates a separate folder from your portfolio repository.
Step 1: Create Labs Folder Structure
In your portfolio repository, create this folder structure:
your-portfolio/
├── _quarto.yml # You'll edit this
├── index.qmd # Your home page
├── labs/ # CREATE THIS FOLDER
│ └── lab_0/ # CREATE THIS FOLDER
│ ├── lab_0_template.qmd # You'll copy this file here
│ └── data/ # CREATE THIS FOLDER (copy data folder)
└── ... (other files)
In RStudio: 1. In the Files pane, click “New Folder” 2. Name it labs 3. Inside labs, create another folder called lab_0 4. Inside lab_0, create a folder called data
Step 3: Test Your Setup
- Save your
_quarto.ymlfile - In RStudio, go to Build → Render Website
- Check that you now see a “Labs” dropdown in your navigation menu
Weekly Workflow (Every Lab)
Step 1: Get the Lab Template
- Go to the course repository
- Navigate to
labs/lab_X/(where X is the lab number) - Download or copy the lab template files
Step 2: Set Up Your Lab Folder
- In your portfolio, create a new folder:
labs/lab_X/ - Copy the template
.qmdfile into this folder - Copy any data files into
labs/lab_X/data/
Step 3: Customize the Template
- Open the lab
.qmdfile - Update the author field with your name
- Complete all the exercises
- Fill in all the “[YOUR ANSWER]” sections
Step 5: Render and Deploy
Build your site: Build → Render Website
Check locally: Make sure everything looks good
Commit your changes: (You can use GitHub Desktop here as well)
git add . git commit -m "Complete Lab X: [brief description]"Push to GitHub:
git push origin mainSet up the GitHub page in the repo settings
Check your live site: Your portfolio should update automatically
Troubleshooting
“Website won’t render”
- Check if any error messages/warnings appear in the RStudio console
- Check your
_quarto.ymlindentation - Make sure all required packages are installed
- Make sure all file paths are correct
- Look for typos in file names
“Code doesn’t work”
- Check that data files are in the right location
- Verify you’re using relative paths:
"data/filename.csv" - Make sure you’re working within your R project
“GitHub Pages isn’t updating”
- Confirm you committed and pushed all changes
- Check that GitHub Actions completed successfully (green checkmark)
- Wait a few minutes - updates can take time
Tips for Success
- Work incrementally: Complete one exercise at a time, render frequently
- Use descriptive commit messages: “Complete filtering exercises for Lab 0”
- Keep files organized: Don’t put data files in wrong folders
- Test locally first: Always render and check before pushing
- Ask for help: Use office hours or discussion board if stuck
Example Portfolio Structure (After Several Labs)
your-portfolio/
├── _quarto.yml
├── index.qmd
├── labs/
│ ├── lab_0/
│ │ ├── index.qmd
│ │ └── data/
│ │ └── car_sales_data.csv
│ ├── lab_1/
│ │ ├── index.qmd
│ │ └── data/
│ │ └── census_data.csv
│ └── lab_2/
│ ├── index.qmd
│ └── data/
│ └── housing_data.csv
└── docs/ # Generated by Quarto
├── index.html
├── weekly-notes/
├── labs/
└── ...
By the end of the semester, you’ll have a professional portfolio showcasing all your data analysis work!
Questions?
- Technical issues: Post on Canvas discussion board
- Conceptual questions: Come to office hours
- GitHub problems: Include error messages in your questions