diff --git a/_freeze/index/execute-results/html.json b/_freeze/index/execute-results/html.json index 0f5eb99..6572e8b 100644 --- a/_freeze/index/execute-results/html.json +++ b/_freeze/index/execute-results/html.json @@ -1,8 +1,10 @@ { - "hash": "9939f87c8d1c017d5bd8540ed217131c", + "hash": "56e9a49e3efce43d8de5725a9d93d2d1", "result": { - "markdown": "---\ntitle: Reproduciblity and Data Science in R\nsubtitle: \"Fall 2023\"\nformat: html\n---\n\n\nWelcome to the syllabus for the CCT Data Science fall workshop series: **Reproducibility and Data Science in R.** If you didn't register for the course this year, sign up for our [mailing list](https://datascience.cct.arizona.edu/contact) to be notified when enrollment opens for next year's iteration and to be notified of our other monthly workshops.\n\n## Schedule (tentative)\n\nWe'll meet on Tuesdays and Thursdays from 11am to 1pm via Zoom (link)\n\n\n\n\n::: {.cell}\n::: {.cell-output-display}\n```{=html}\n
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n \n \n \n
LessonDateThemeTopicLinks
1Tue, 9/5Manage & OrganizeProject managment and coding best practices
\n
2Thu, 9/7Share & CollaborateUsing shell commands
\n
3Tue, 9/12Share & CollaborateVersion control with git
\n
4Thu, 9/14Share & CollaborateDeveloping code on GitHub
\n
5Tue, 9/19Share & CollaborateCollaborating with GitHub
\n
6Thu, 9/21Tidy & WrangleData Manipulation
\n
7Tue, 9/26Repeat & ReproduceIntermediate R programming I
\n
8Thu, 9/28Repeat & ReproduceIntermediate R programming II
9Tue, 10/3Document & PublishDocumentation and literate programming
10Thu, 10/5Document & PublishGetting credit for your hard work
Tue, 10/17HelpDrop-in help session
Tue, 10/24Show & TellAn opportunity for you to show off what you've learned
\n
\n```\n:::\n:::\n\n\n## Code of Conduct\n\n> Our group's mission is to enable scientists.\n> This means treating people with respect and responding in a polite and helpful way.\n>\n> Our group is committed to ensuring a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.\n>\n> Examples of unacceptable behavior by members, collaborators, and contributors include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.\n\nRead our full [code of conduct](https://osf.io/tzmhp/wiki/Code%20of%20Conduct/) and please report any violations or concerns to the course instructors or to Kristina Riemer ([kristinariemer\\@arizona.edu](mailto:kristinariemer@arizona.edu)).\n\n## Helpful Reads\n\nThis workshop series doesn't have anything like \"required reading\", but we think these books and websites are good companions.\n\nData analysis in R:\n\n- [R for Data Science (2e)](https://r4ds.hadley.nz/)\n- [Building reproducible analytical pipelines with R](https://raps-with-r.dev/) \n\nBest practices for reproducibility:\n\n- [Good enough practices in scientific computing](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1005510)\n- [Data organization in spreadsheets](https://doi.org/10.1080/00031305.2017.1375989)\n- [A beginner's guide to conducting reproducible research](https://doi.org/10.1002/bes2.1801)\n- [The Turing Way: Guide for Reproducible Research](https://the-turing-way.netlify.app/reproducible-research/reproducible-research)\n\nVersion control:\n\n- [Excuse me, do you have a moment to talk about version control?](https://doi.org/10.7287/peerj.preprints.3159v2)\n- [Happy Git and GitHub for the useR](https://happygitwithr.com/)\n", - "supporting": [], + "markdown": "---\ntitle: Reproduciblity and Data Science in R\nsubtitle: \"Fall 2023\"\nformat: html\n---\n\n\nWelcome to the syllabus for the CCT Data Science fall workshop series: **Reproducibility and Data Science in R.** If you didn't register for the course this year, sign up for our [mailing list](https://datascience.cct.arizona.edu/contact) to be notified when enrollment opens for next year's iteration and to be notified of our other monthly workshops.\n\n## Schedule (tentative)\n\nWe'll meet on Tuesdays and Thursdays from 11am to 1pm via Zoom (link)\n\n\n\n\n::: {.cell}\n::: {.cell-output-display}\n```{=html}\n
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n \n \n \n
LessonDateThemeTopicLinks
1Tue, 9/5Manage & OrganizeProject managment and coding best practices
\n
2Thu, 9/7Share & CollaborateUsing shell commands
\n
3Tue, 9/12Share & CollaborateVersion control with git
\n
4Thu, 9/14Share & CollaborateDeveloping code on GitHub
\n
5Tue, 9/19Share & CollaborateCollaborating with GitHub
\n
6Thu, 9/21Tidy & WrangleData Manipulation
\n
7Tue, 9/26Repeat & ReproduceIntermediate R programming I
\n
8Thu, 9/28Repeat & ReproduceIntermediate R programming II
9Tue, 10/3Document & PublishDocumentation and literate programming
10Thu, 10/5Document & PublishGetting credit for your hard work
Tue, 10/17HelpDrop-in help session
Tue, 10/24Show & TellAn opportunity for you to show off what you've learned
\n
\n```\n:::\n:::\n\n\n## Code of Conduct\n\n> Our group's mission is to enable scientists.\n> This means treating people with respect and responding in a polite and helpful way.\n>\n> Our group is committed to ensuring a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.\n>\n> Examples of unacceptable behavior by members, collaborators, and contributors include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.\n\nRead our full [code of conduct](https://osf.io/tzmhp/wiki/Code%20of%20Conduct/) and please report any violations or concerns to the course instructors or to Kristina Riemer ([kristinariemer\\@arizona.edu](mailto:kristinariemer@arizona.edu)).\n\n## Helpful Reads\n\nThis workshop series doesn't have anything like \"required reading\", but we think these books and websites are good companions.\n\nData analysis in R:\n\n- [R for Data Science (2e)](https://r4ds.hadley.nz/)\n- [Building reproducible analytical pipelines with R](https://raps-with-r.dev/) \n\nBest practices for reproducibility:\n\n- [Good enough practices in scientific computing](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1005510)\n- [Data organization in spreadsheets](https://doi.org/10.1080/00031305.2017.1375989)\n- [A beginner's guide to conducting reproducible research](https://doi.org/10.1002/bes2.1801)\n- [The Turing Way: Guide for Reproducible Research](https://the-turing-way.netlify.app/reproducible-research/reproducible-research)\n\nVersion control:\n\n- [Excuse me, do you have a moment to talk about version control?](https://doi.org/10.7287/peerj.preprints.3159v2)\n- [Happy Git and GitHub for the useR](https://happygitwithr.com/)\n", + "supporting": [ + "index_files" + ], "filters": [ "rmarkdown/pagebreak.lua" ], diff --git a/index.qmd b/index.qmd index 2381195..bda93dc 100644 --- a/index.qmd +++ b/index.qmd @@ -10,7 +10,7 @@ Welcome to the syllabus for the CCT Data Science fall workshop series: **Reprodu We'll meet on Tuesdays and Thursdays from 11am to 1pm via Zoom (link) - + ```{r} #| echo: false diff --git a/lessons/5-github-collab/fork_btn.png b/lessons/5-github-collab/fork_btn.png new file mode 100644 index 0000000..41f91ee Binary files /dev/null and b/lessons/5-github-collab/fork_btn.png differ diff --git a/lessons/5-github-collab/fork_diagram.png b/lessons/5-github-collab/fork_diagram.png new file mode 100644 index 0000000..c91975a Binary files /dev/null and b/lessons/5-github-collab/fork_diagram.png differ diff --git a/lessons/5-github-collab/github-diagram-bryan.png b/lessons/5-github-collab/github-diagram-bryan.png new file mode 100644 index 0000000..1fbf0e7 Binary files /dev/null and b/lessons/5-github-collab/github-diagram-bryan.png differ diff --git a/lessons/5-github-collab/merge_conflict.png b/lessons/5-github-collab/merge_conflict.png new file mode 100644 index 0000000..791ec95 Binary files /dev/null and b/lessons/5-github-collab/merge_conflict.png differ diff --git a/lessons/5-github-collab/notes.qmd b/lessons/5-github-collab/notes.qmd index ffb5aea..177232a 100644 --- a/lessons/5-github-collab/notes.qmd +++ b/lessons/5-github-collab/notes.qmd @@ -18,7 +18,8 @@ Learners will fork and clone a repository on GitHub and use branches to open pul - Share a repo with everyone & have everyone clone w/ RStudio - Ask 1 (one) volunteer to make a change and practice commit + push - Both instructor and volunteer make a change in the same file and push to main - - Show how to resolve merge conflict on GitHub + - Should error for whoever pushes second + - Try following hints and pull, then set `git config pull.rebase false` - Working on branches (slides) diff --git a/lessons/5-github-collab/pull_error.png b/lessons/5-github-collab/pull_error.png new file mode 100644 index 0000000..8520904 Binary files /dev/null and b/lessons/5-github-collab/pull_error.png differ diff --git a/lessons/5-github-collab/push_error.png b/lessons/5-github-collab/push_error.png new file mode 100644 index 0000000..7d6db34 Binary files /dev/null and b/lessons/5-github-collab/push_error.png differ diff --git a/lessons/5-github-collab/references.bib b/lessons/5-github-collab/references.bib new file mode 100644 index 0000000..a11bcaa --- /dev/null +++ b/lessons/5-github-collab/references.bib @@ -0,0 +1,15 @@ + +@article{bryan2018, + title = {Excuse me, do you have a moment to talk about version control?}, + author = {Bryan, Jennifer}, + year = {2018}, + month = {01}, + date = {2018-01}, + journal = {The American Statistician}, + pages = {20{\textendash}27}, + volume = {72}, + number = {1}, + doi = {10.1080/00031305.2017.1399928}, + url = {https://www.tandfonline.com/doi/full/10.1080/00031305.2017.1399928}, + note = {Publisher: Taylor & Francis} +} diff --git a/lessons/5-github-collab/slides.qmd b/lessons/5-github-collab/slides.qmd new file mode 100644 index 0000000..7a8a499 --- /dev/null +++ b/lessons/5-github-collab/slides.qmd @@ -0,0 +1,173 @@ +--- +title: "Collaborate With GitHub" +subtitle: "Session 5" +format: revealjs +editor: visual +chalkboard: true +footer: "[Reproduciblity & Data Science in R](../../index.html)" +bibliography: references.bib +--- + +## Review + +::: callout-note +## Word Bank + +repo \| commit \| remote \| push \| pull \| add +::: + +::: incremental +1. A collection of files tracked by git +2. A snapshot of the state of a repository +3. `git` \_\_\_ is used to tell git to track a file +4. For example, a repo on GitHub +5. `git` *\_\_\_\_* is used to synchronize changes on your computer with a remote +::: + +## Homework + +Did anyone add a repo to GitHub? +What difficulties did you encounter? + +## Collaborating with GitHub + +![](github-diagram-bryan.png){fig-align="center" width="671"} + +::: aside +Figure 2 from [@bryan2018] +::: + +::: notes +A GitHub repo can be used to coordinate collaboration + +If two people have permissions, both can push changes to the repo + +Ask for a volunteer and give them permission to push to a repo +::: + +## Example repo + +- Everyone practice cloning this example repo as a new RStudio project: + +- Need one volunteer to edit the README.md and practice commit + push + +## Dealing with Conflicts + +- What happens when two people make conflicting edits to a file and push them? + +- Creates a *merge conflict* + + ![](push_error.png) + +## Ok, try `git pull` + +![](pull_error.png) + +## Merge, rebase, fast-forward?? + +- These are alternative ways to deal with conflicts---we won't get into the deatils + +- For now, we recommend you stick with the "merge" option + +. . . + +Use: + +``` bash +git config pull.rebase false +``` + +Or, if you want to set this option for all future repos too + +``` bash +git config --global pull.rebase false +``` + +## Fixing a Merge Conflict + +![](merge_conflict.png) + +- Resolve the conflict however you want (i.e. keep one of the two sections) + +- Delete all lines with `<<<<<<<`, `>>>>>>>`, or `=======` + +- Save and commit + +::: notes +Let's have a round of applause for our volunteer! +::: + +## Avoid merge conflicts by working on branches + +Each person works on a "branch"---an independent series of commits that can be merged back into the "main" branch. + +```{mermaid} +gitGraph + commit + commit + branch person_1 + commit + commit + commit + checkout main + branch person_2 + commit + commit + checkout main + merge person_1 + merge person_2 + commit + +``` + +## Working on a Branch + +- Make a new branch with your name using RStudio's Git pane + +- Commit changes and push to your branch + +- View changes on GitHub + +## Pull Requests + +A request to merge changes into the main branch + +- Need another volunteer to share screen and be guided through making a pull request + +- This time, everyone can follow along! + +## Forks {.smaller} + +::: columns +::: {.column width="40%"} +What if you don't have permission to push to a GitHub repo but you want to contribute? +Make a fork! + +![](fork_btn.png){fig-align="center"} +::: + +::: {.column width="60%"} + +![](fork_diagram.png){fig-align="center" width="627"} +::: +::: + +## Collaborating with Forks + +To contribute to a repo you don't have push permission for: + +1. **Fork** the repo to your own GitHub +2. **Clone** the fork to your local computer +3. Make **commits** (ideally on a **branch**) +4. Make a **pull request** to the upstream repo + +::: callout-tip +## Exercise + +In pairs, practice this workflow to make a PR to our example repo +::: + +## References + +::: refs +::: diff --git a/schedule.csv b/schedule.csv index 46b1ffa..56e8a0f 100644 --- a/schedule.csv +++ b/schedule.csv @@ -3,7 +3,7 @@ Lesson,Date,Theme,Topic,Links,Notes 2,2023-09-07,Share & Collaborate,Using shell commands,[slides](lessons/2-shell/slides.html),"Install git, carpentries shell episodes 1 & 2" 3,2023-09-12,Share & Collaborate,Version control with git,[slides](lessons/3-git/slides.html),"git novice lessons 2-4, then git pane of RStudio" 4,2023-09-14,Share & Collaborate,Developing code on GitHub,[slides](lessons/4-github-basics/slides.html),"git_sitrep(), use_github(), git novice lesson 7" -5,2023-09-19,Share & Collaborate,Collaborating with GitHub,[slides](https://docs.google.com/presentation/d/1oKZ2VK50_CW90Um_iOJ8D6KEPgvapqYvXBFMlx0_aiw/),"git novice lesson 8, pr_init(), pr_push(), pr_finish()" +5,2023-09-19,Share & Collaborate,Collaborating with GitHub,[slides](lessons/5-github-collab/slides.html),"git novice lesson 8, pr_init(), pr_push(), pr_finish()" 6,2023-09-21,Tidy & Wrangle,Data Manipulation,[slides](lessons/6-data-manipulation/slides.html),data carpentry R ecology episodes 2 & 3 7,2023-09-26,Repeat & Reproduce,Intermediate R programming I,[slides](lessons/7-intermediate-r-1/slides.html),functions 8,2023-09-28,Repeat & Reproduce,Intermediate R programming II,,iteration (and anonymous functions)