Primary method of communication
The team’s primary method of communication outside of meetings (e.g. Slack, text messages, etc.)
lab-04
. It contains the starter documents you need to complete the lab.*.pdf
to a newline in the file .gitignore
in your project directory and then save, commit and push the changes you made to that file..gitignore
files and pull the changes that were pushed by team member 0..gitignore
files in their directory that include the line *.pdf
In the real world, data scientists and statisticians often work in research teams. It is a skill to be able to communicate and work together on common projects. Thus, the remaining labs + your project will be team based.
Teams work better when members have a common understanding of the team’s goals and expectations for collaboration. The purpose of this activity is to help your team making a plan for working together during lab and outside of the scheduled lab time.
Each team member will have some ideas about how a team should operate. These ideas may be very different. This is your opportunity to share your thoughts and ideas to promote optimal team function and prevent misunderstandings in the future.
Discuss with your group a team name to be called. Your GitHub repos will be created for this team name moving forward. Report your team name to your Lab Leader before moving on.
Before completing the lab today, you will complete a team agreement. Discuss each of the items below with all in-person team members. If necessary, also follow up this week with any missing team members.
Have one person act as the recorder and type the team’s decisions in the team-agreement.qmd
file.
Be sure the team agrees on an item before it is added to the document.
Once the document is complete, the recorder should render, commit, and push the team agreement to GitHub. All team members can refer to this document throughout the semester.
Identify a 1 - 2 hour weekly block outside of lab where the team can meet to work on assignments. All team members should block off this time on their calendar in case the group needs to meet to finish lab or work on the project.
How the team will meet to work together (e.g. in-person, Zoom, Facetime, Google Hangouts). Be sure every member is able to access the virtual meeting space, if needed. If you are unable to find a weekly time when the team can meet, briefly outline a plan to work on assignments outside of lab. Otherwise, you can delete this item.
The team’s primary method of communication outside of meetings (e.g. Slack, text messages, etc.)
Keep in mind your team may want to have time to review the lab before turning it in to make sure it is a cohesive write up.
If you are missing teammates for today’s lab, it is your responsibility to reach out, say hello, and communicate with them that they must contribute to the above and below questions before submitting lab-04 to Gradescope. You can find their email in the teams repo. The link to the teams repo is located on our website on the teaching team tab.
Working in teams includes using a shared GitHub repo for labs and projects. Sometimes things will go swimmingly, and sometimes you’ll run into merge conflicts.
When you and your teammates work on the lines of code within a document, and both try to push your changes, you will run into issues. Merge conflicts happen when you merge branches that have competing renders, and Git needs your help to decide which changes to incorporate in the final merge.
Our first task today is to walk you through a merge conflict!
If you haven’t yet done so since filling out the Team Agreement, now is a good time to render, commit, and push. Make sure that you render and push all changed documents and your Git pane is completely empty before proceeding.
Git will put conflict markers in your code that look like:
<<<<<<< HEAD
See also: [dplyr documentation](https://dplyr.tidyverse.org/)
=======
See also [ggplot2 documentation](https://ggplot2.tidyverse.org/)
>>>>>>> some1alpha2numeric3string4
The ===
s separate your changes (top) from their changes (bottom).
Note that on top you see the word HEAD
, which indicates that these are your changes.
And at the bottom you see some1alpha2numeric3string4
(well, it probably looks more like 28e7b2ceb39972085a0860892062810fb812a08f
).
This is the hash (a unique identifier) of the render your collaborator made with the conflicting change.
Your job is to reconcile the changes: edit the file so that it incorporates the best of both versions and delete the <<<
, ===
, and >>>
lines. Then you can stage and render the result.
git config --global pull.rebase false
into your Terminal in RStudio and press enter. (Look for the tab next to the Console, and ask if you can’t find it.)Our goal is to see two different types of merges: first we’ll see a type of merge that git can’t figure out on its own how to do on its own (a merge conflict) and requires human intervention, then another type of where that git can figure out how to do without human intervention.
Doing this will require some tight choreography, so pay attention!
Take turns in completing the exercises, only one member at a time. Others should just watch, not doing anything on their own projects (this includes not even pulling changes!) until they are instructed to. If you feel like you won’t be able to resist the urge to touch your computer when it’s not your turn, we recommend putting your hands in your pockets or sitting on them!
Before starting: everyone on your team should have followed the instructions in the Setup section above. Repeating from earlier: everyone should clone the repo, open the lab4.qmd
document, run git config --global pull.rebase false
in the Terminal, and know which role number(s) they are.
🛑 Make sure everyone has completed this step before moving on.
Role 1:
🛑 Make sure the previous role has finished before moving on to the next step.
Role 2:
🛑 Make sure the previous role has finished before moving on to the next step.
Role 3:
🛑 Make sure the previous role has finished before moving on to the next step.
Role 4:
🛑 Make sure the previous role has finished before moving on to the next step.
Everyone: Pull, and observe the changes in your document.
We’ll use the tidyverse package for much of the data wrangling and visualization.
library(tidyverse)
Since the exercises for this week are short it’s possible not every team member will get to commit and push during the workshop. However each team member should review what was created, fix typos, make edits for better presentation, etc. either during or after the workshop, and before the deadline.
Note: Everyone should intellectually contribute to every question. However, no two teammates should work on the same question at the same time below.
In this lab you’ll construct the data set!
The following visualization was shared on Twitter as “extraordinary misleading”.
If you haven’t yet done so, now is a good time to render, commit, and push. Make sure that you commit and push all changed documents and your Git pane is completely empty before proceeding.
Everyone now pull
tribble()
function to create the data frame. To get a sense of how tribble()
works, try running the code below in your console and then looking at the structure of the resulting data frame df
.<- tribble(
df ~date, ~count,
"1/1/2020", 15,
"2/1/2020", 20,
"3/1/2020", 22,
)
Print the first 5 rows of the data frame after creating it. You may name the data frame what you like. We often try and keep data frame names small and informative.
If you haven’t yet done so, now is a good time to render, commit, and push. Make sure that you commit and push all changed documents and your Git pane is completely empty before proceeding.
Everyone now pull
If you haven’t yet done so, now is a good time to render, commit, and push. Make sure that you commit and push all changed documents and your Git pane is completely empty before proceeding.
Everyone now pull
If you haven’t yet done so, now is a good time to render, commit, and push. Make sure that you commit and push all changed documents and your Git pane is completely empty before proceeding.
Everyone now pull
If you haven’t yet done so, now is a good time to render, commit, and push. Make sure that you commit and push all changed documents and your Git pane is completely empty before proceeding.
Everyone now pull
Once you are finished with the lab, you will your final PDF document to Gradescope.
To submit your assignment:
Component | Points |
---|---|
Team Agreement | 10 |
Ex 1 | 5 |
Ex 2 | 5 |
Ex 3 | 15 |
Ex 4 | 5 |
Ex 5 | 5 |
Workflow & formatting | 5 |
Total | 50 |