PUBH 523/623: Interactive R Practice
Welcome! This site hosts the weekly practice assignments for PUBH 523/623. Each practice page lets you try out that week’s lessons right in your browser: the R code you write here runs using webR, so you can start before you have everything set up in RStudio.
What the practice assignments are
There is one practice assignment each week, and it covers that week’s lessons. Practice is for learning, not for testing you, so:
- It’s graded on completion. You get a check if you complete at least 75% of the question parts, whether your answers are right or wrong. Each practice counts equally.
- It’s due Sunday at 11pm. On-time work gets feedback from me. You can still turn it in any time before the course ends for full credit, just without feedback (unless you email me to ask).
- Working together is encouraged! Talk it through with classmates, but everyone submits their own work.
See the schedule for due dates and the syllabus for the full grading details.
How to complete a practice page
Pick a practice from the Practice Exercises menu above. Each page starts with a table of that week’s lessons (with links to the videos and slides), then walks through the ideas step by step. You’ll see a few kinds of questions.
Code questions
These have a small R editor you can type straight into. Most start with a ______ blank to replace with your code. Some “fix the error” questions start with broken code instead: run it, read the error, and fix it. Then use the buttons above the editor:
- Run Code: runs your code and checks it. A green box means you’ve got it. Any other color means it’s not quite right yet, and the message will nudge you toward the fix.
- Show Hint: reveals a hint. Some questions have more than one, so keep clicking if you’re still stuck.
- Start Over: resets the editor to the starting code.
- Format: tidies up the spacing in your code so you can see what nicely formatted R looks like.
Multiple choice and short answer questions
Some answers are words, not code. For these, pick an option and you’ll get the same green or “not quite” feedback right away. For select all that apply questions (and typed answers), make your choices, then click Check my answer. Open the Hint box under the question if you get stuck.
Self-check tasks
Some tasks happen outside the page, like setting up your course folder, making an R Project, or the hands-on steps in RStudio at the end of each practice. Check the box once you’ve done it. These can’t be graded automatically, so they’re just for keeping track.
Your work is saved in this browser only
As you work, the code you type, your multiple choice and short answers, and your checkmarks on the My Progress page are saved automatically in your browser. Close the tab, come back tomorrow, and your work will still be there, as long as you use the same browser on the same device and haven’t cleared your browsing data.
That’s not a permanent save. Clearing your cache, using a private/incognito window, or switching browsers or computers will lose it. Your downloaded .qmd is your real copy, so download it when you finish, and again any time you want a backup.
How to turn it in
Every practice page ends with a Download my answers as .qmd button. That file is a real Quarto document with all of your answers, numbered to match the page: code answers go in R chunks, multiple choice and short answers go in as text, and your AI Use Statement goes at the top. It also has sections for the hands-on steps at the end of the page. Practice 1 walks you through these steps in detail the first time.
- Fill in the AI Use Statement near the bottom of the page. If you didn’t use AI, just pick “I did not use AI.” (More below.)
- Download your answers with the button at the bottom of the page.
- File it. Move the file from your Downloads folder into the
practicefolder inside your course folder, and rename it tolastname_firstinitial_practice_##.qmd(for example,wakim_n_practice_01.qmd). No spaces! - Open it in RStudio and put your name in the
author:line at the top. Starting with Practice 2, open your course’s R Project first (double-clickPUBH_523_26F.Rproj), then open the file from the Files pane, sohere()finds your files. - Render it with the Render button (or Cmd + Shift + K on Mac / Ctrl + Shift + K on PC). This makes an
.htmlfile next to your.qmd. - Submit both files, the
.qmdand the.html, to that week’s practice assignment on Brightspace.
AI Use Statement
Using AI is not required in this class. Every practice page has an AI Use Statement box near the end. If you used an AI tool (ChatGPT, Claude, Copilot, Gemini, an RStudio assistant, etc.), say which tool, what you used it for, and which questions. If you didn’t, just select “I did not use AI.” Either way, it goes at the top of your downloaded .qmd.
For practice, AI can help you understand (explain an error or a concept, explain what a function does, check an answer you already worked out), but it should not do the problem for you. Check the table of allowed uses in the Generative AI Policy before using it.
Getting help
- Slack is the best place for questions! Your classmates can help, and I answer there too (usually within 24 hours on weekdays).
- Office hours are a great place to work on practice, even if you don’t have a specific question.
- Each practice page links to that week’s lesson videos and slides at the top.
Get started
Pick a practice from the Practice Exercises menu above, or jump straight to Practice 1.
You can see which exercises you’ve finished on the My Progress page (tracked in your own browser only).