Module 6 - Assignments
Cross-references with Quarto & For-Loops (Bonus)
Step 1: Clone your module 6 assignments repository
Open github.com in your browser and navigate to the GitHub organization for the course (or use your bookmark).
Find the repository
md-06-assignments-USERNAMEthat ends with your GitHub username, and open it.Click on the green Code button.
Copy the HTTPS URL to your clipboard.
Open the ds4owd workspace on posit.cloud
Click New Project > New Project from Git Repository
Paste the HTTPS URL from GitHub into the URL of your Git Repository field.
Wait until the project is deployed.
Step 2: Complete the cross-references assignment
- In the Files pane (bottom right), open
01a-cross-references.qmdand follow the instructions to work through the tasks.
This assignment builds on the cross-references material covered in lecture 6. If you need a refresher:
- Review the lecture slides
- Practice with the exercises in
01a-cref-your-turn.qmdon Posit Cloud
Remember the three steps for cross-referencing:
- Add a caption (
tbl-caporfig-cap) - Add a label starting with
tbl-orfig- - Reference with
@tbl-...or@fig-...
Step 3: (Optional) Bonus assignment on for-loops
This is an optional bonus assignment for students who want to deepen their understanding of iteration and for-loops in R. It is not required to complete the course, but it will help you become more proficient with R programming.
You can skip this step and proceed directly to Step 4 if you prefer.
- In the Files pane (bottom right), open
02a-for-loops-iteration.qmdand follow the instructions to work through the tasks.
This assignment helps you understand when for-loops are necessary and when they are not. You will learn to:
- Distinguish between situations requiring for-loops and those that don’t
- Write for-loops to create multiple separate outputs
- Store plots and tables in lists
- Debug common for-loop errors
The assignment uses global sanitation data to demonstrate practical applications of iteration.
Step 4: Commit and push your changes
Navigate to the Git pane in the top-right window of RStudio
Check the box next to all files to stage them for a commit
Click on the Commit button. A new window opens.
Enter a commit message in the Commit message field. For example:
completed module 6 assignmentsClick on the Commit button
If you see a message that confirms your commit, click on Close. If you do not see this message, make sure you have staged the files (checked the box next to them) for commit and entered a commit message.
Click on the Push button in the top right corner.
Enter your GitHub username and click OK
Enter your GitHub Personal Access Token (PAT) in the field and click OK. This is the personal access token you created in Module 1.
If you see a message that says HEAD -> main, then you have successfully pushed your changes to the remote repository on GitHub. Click Close. If you do not see this message, make sure you have entered your GitHub username and GitHub PAT correctly.
If you have stored your PAT in a Word file, a blank space might have been copied along with the PAT. We recommend using a TXT file (Notepad on Windows or TextEdit on Mac) or a password manager to store your PAT securely.
You need to enter the GitHub Personal Access Token (PAT) you created in Module 1 to push your changes back to GitHub.
Step 5: Open an issue on GitHub
Open github.com in your browser.
Navigate to the GitHub organization for the course.
Find the repository
md-06-assignments-USERNAMEthat ends with your GitHub username.You can verify here that your changes have been pushed to the remote repository by looking at the text next to the
01a-cross-references.qmdfile. It should display the commit message you entered in the previous step.Click on the Issues tab.
Click on the green New issue button.
In the Title field write:
Completed module 6 assignmentsIn the Leave a comment field, tag the course instructors
@seawaR@massarin@larnsceand share:- A question about cross-references or data types, OR
- If you completed the bonus assignment: what you learned from working with for-loops
Scroll down the page and click the green Submit new issue button.
Congratulations! You have completed the module 6 assignments and are now ready for the next module.