Slide 1

Slide 1 text

R & GitHub sitting in a tree… mine-cetinkaya-rundel cetinkaya.mine@gmail.com @minebocek mine çetinkaya-rundel university of edinburgh & rstudio bit.ly/r-git-tree

Slide 2

Slide 2 text

bit.ly/r-git-tree context

Slide 3

Slide 3 text

bit.ly/r-git-tree students with little
 to no background
 in computing, data
 science, or statistics (but with enthusiasm to learn!) Intro to Data Science students ready to tackle real life data science problems using modern computational tools

Slide 4

Slide 4 text

bit.ly/r-git-tree fundamentals of data & data viz, confounding variables, Simpson’s paradox tidy data, data frames vs. summary tables, recoding & transforming, web scraping & iteration building & selecting models, visualizing interactions, prediction & validation, inference via simulation data science ethics, interactive viz & reporting, text analysis, Bayesian inference modern computing reproducibility collaboration communication

Slide 5

Slide 5 text

bit.ly/r-git-tree Intro to Data Science Duke Duke UoE yr 1 18 open to all target: yrs 1&2 100 yr 1 plan: open to all 100, plan: >>100

Slide 6

Slide 6 text

bit.ly/r-git-tree infrastructure " instructor # student

Slide 7

Slide 7 text

bit.ly/r-git-tree language integrated development environment literate programming version control collaboration, publishing, course management # student

Slide 8

Slide 8 text

bit.ly/r-git-tree one organization per class one repo per assignment per student / team weekly labs [team] bi-weekly homework assignments [individual] two take-home exams [individual] two-phase project [team]

Slide 9

Slide 9 text

bit.ly/r-git-tree " instructor + ghclass R package of tools for managing GitHub class organization accounts

Slide 10

Slide 10 text

bit.ly/r-git-tree ghclass > Functions are prefixed with either org, repo, team, github, or local_repo to indicate what they operate on. > Functions are vectorized over their parameters, to allow related operations to be grouped. > Functions the unix design philosophy when possible, work towards simple & composable functions. > Functions are verbose to communicate what’s happening, but they can be quieted down. > Actions are non-destructive and/or backed by Git, the handful of dangerous operations throw warnings.

Slide 11

Slide 11 text

bit.ly/r-git-tree the whole game

Slide 12

Slide 12 text

bit.ly/r-git-tree 00. create course roster " instructor #> # A tibble: 6 x 4 #> uid email ghname team #> #> 1 za17 anya@school.edu ghclass-anya team-01 #> 2 kb34 bruno@school.edu ghclass-bruno team-01 #> 3 ac13 celine@school.edu ghclass-celine team-01 #> 4 bd88 diego@school.edu ghclass-diego team-02 #> 5 se01 elijah@school.edu ghclass-elijah team-02 #> 6 df00 francis@school.edu ghclass-francis team-02

Slide 13

Slide 13 text

bit.ly/r-git-tree 01. create assignment " instructor

Slide 14

Slide 14 text

bit.ly/r-git-tree 02. create repo with starter docs " instructor

Slide 15

Slide 15 text

bit.ly/r-git-tree 02. create repo with starter docs " instructor

Slide 16

Slide 16 text

bit.ly/r-git-tree 03. create student repos org_create_assignment(org = "ghclass-demo", repo = paste0("hw-03-ncbikecrash-", roster$ghname), user = roster$ghname, source_repo = “ghclass-demo/hw-03-ncbikecrash") #> ✔ Created repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-anya'. #> ✔ Created repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-bruno'. #> ✔ Created repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-celine'. #> ✔ Created repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-diego'. #> ✔ Created repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-elijah'. #> ✔ Created repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-francis'. #> ✔ Added user 'ghclass-anya' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-anya'. #> ✔ Added user 'ghclass-bruno' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-bruno'. #> ✔ Added user 'ghclass-celine' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-celine'. #> ✔ Added user 'ghclass-diego' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-diego'. #> ✔ Added user 'ghclass-elijah' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-elijah'. #> ✔ Added user 'ghclass-francis' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-francis'. #> ✔ Cloned 'ghclass-demo/hw-03-ncbikecrash'. #> ✔ Pushed (mirror) 'hw-03-ncbikecrash' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-anya'. #> ✔ Pushed (mirror) 'hw-03-ncbikecrash' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-bruno'. #> ✔ Pushed (mirror) 'hw-03-ncbikecrash' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-celine'. #> ✔ Pushed (mirror) 'hw-03-ncbikecrash' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-diego'. #> ✔ Pushed (mirror) 'hw-03-ncbikecrash' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-elijah'. #> ✔ Pushed (mirror) 'hw-03-ncbikecrash' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-francis'. #> ✔ Removed local copy of 'ghclass-demo/hw-03-ncbikecrash' " instructor

Slide 17

Slide 17 text

bit.ly/r-git-tree 03. create student repos " instructor

Slide 18

Slide 18 text

bit.ly/r-git-tree 04. modify student repos repo_add_file(repo = org_repos("ghclass-demo", "hw-03-"), file = "files/nc-county-map.png") #> ✔ Added file 'nc-county-map.png' to repo 'ghclass-demo/hw-03-ncbikecrash'. #> ✔ Added file 'nc-county-map.png' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-anya'. #> ✔ Added file 'nc-county-map.png' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-bruno'. #> ✔ Added file 'nc-county-map.png' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-celine'. #> ✔ Added file 'nc-county-map.png' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-diego'. #> ✔ Added file 'nc-county-map.png' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-elijah'. #> ✔ Added file 'nc-county-map.png' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-francis'. " instructor

Slide 19

Slide 19 text

bit.ly/r-git-tree 04. modify student repos repo_add_file(repo = org_repos("ghclass-demo", "hw-03-"), file = "files/hw-03-ncbikecrash.Rmd", message = "Fix date", overwrite = TRUE) #> ✔ Added file 'hw-03-ncbikecrash.Rmd' to repo 'ghclass-demo/hw-03-ncbikecrash'. #> ✔ Added file 'hw-03-ncbikecrash.Rmd' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-anya'. #> ✔ Added file 'hw-03-ncbikecrash.Rmd' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-bruno'. #> ✔ Added file 'hw-03-ncbikecrash.Rmd' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-celine'. #> ✔ Added file 'hw-03-ncbikecrash.Rmd' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-diego'. #> ✔ Added file 'hw-03-ncbikecrash.Rmd' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-elijah'. #> ✔ Added file 'hw-03-ncbikecrash.Rmd' to repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-francis'. " instructor

Slide 20

Slide 20 text

bit.ly/r-git-tree 05. work on assignment # student

Slide 21

Slide 21 text

bit.ly/r-git-tree notebook style editor viewer

Slide 22

Slide 22 text

bit.ly/r-git-tree git

Slide 23

Slide 23 text

bit.ly/r-git-tree diff viewer

Slide 24

Slide 24 text

bit.ly/r-git-tree commit

Slide 25

Slide 25 text

bit.ly/r-git-tree push

Slide 26

Slide 26 text

bit.ly/r-git-tree 06. give feedback & grade " instructor

Slide 27

Slide 27 text

bit.ly/r-git-tree 06. give feedback & grade " instructor

Slide 28

Slide 28 text

bit.ly/r-git-tree tooling

Slide 29

Slide 29 text

bit.ly/r-git-tree github_test_token() #> ✔ Your GitHub token is functioning correctly. sitrep github_test_token("bad token") #> ✖ Your GitHub token failed to authenticate. #> [Error: GitHub API error (401): 401 Unauthorized]

Slide 30

Slide 30 text

bit.ly/r-git-tree #> ✔ Created repo 'ghclass-demo/hw-05-collegemajor-team-01'. #> ✔ Created repo 'ghclass-demo/hw-05-collegemajor-team-02'. #> ✔ Added 'ghclass-anya' to team 'team-01'. #> ✔ Added 'ghclass-bruno' to team 'team-01'. #> ✔ Added 'ghclass-celine' to team 'team-01'. #> ✔ Added 'ghclass-diego' to team 'team-02'. #> ✔ Added 'ghclass-elijah' to team 'team-02'. #> ✔ Added 'ghclass-francis' to team 'team-02'. #> ✔ Added team 'team-01' to repo 'ghclass-demo/hw-05-collegemajor-team-01'. #> ✔ Added team 'team-02' to repo 'ghclass-demo/hw-05-collegemajor-team-02'. #> ✔ Cloned 'ghclass-demo/hw-05-collegemajor'. #> ✔ Pushed (mirror) 'hw-05-collegemajor' to repo 'ghclass-demo/hw-05-collegemajor-team-01'. #> ✔ Pushed (mirror) 'hw-05-collegemajor' to repo 'ghclass-demo/hw-05-collegemajor-team-01'. #> ✔ Pushed (mirror) 'hw-05-collegemajor' to repo 'ghclass-demo/hw-05-collegemajor-team-01'. #> ✔ Pushed (mirror) 'hw-05-collegemajor' to repo 'ghclass-demo/hw-05-collegemajor-team-02'. #> ✔ Pushed (mirror) 'hw-05-collegemajor' to repo 'ghclass-demo/hw-05-collegemajor-team-02'. #> ✔ Pushed (mirror) 'hw-05-collegemajor' to repo 'ghclass-demo/hw-05-collegemajor-team-02'. #> ✔ Removed local copy of 'ghclass-demo/hw-05-collegemajor' org_create_assignment(org = "ghclass-demo", repo = paste0("hw-05-collegemajor-", roster$team), user = roster$ghname, team = roster$team, source_repo = "ghclass-demo/hw-05-collegemajor") teams

Slide 31

Slide 31 text

bit.ly/r-git-tree teams

Slide 32

Slide 32 text

bit.ly/r-git-tree teams

Slide 33

Slide 33 text

bit.ly/r-git-tree repo_style(repo = "ghclass-demo/hw-03-ncbikecrash-ghclass-anya", files = "*.Rmd", draft = TRUE) #> ✔ Created branch 'styler' from 'ghclass-demo/hw-03-ncbikecrash-ghclass-anya'. #> ✔ Cloned 'ghclass-demo/hw-03-ncbikecrash-ghclass-anya@styler'. #> ✔ Created pull request for 'ghclass-demo/hw-03-ncbikecrash-ghclass-anya (master #<= styler)'. styler

Slide 34

Slide 34 text

bit.ly/r-git-tree styler

Slide 35

Slide 35 text

bit.ly/r-git-tree styler

Slide 36

Slide 36 text

bit.ly/r-git-tree repo_delete(repo = org_repos(org = "ghclass-demo", filter = "hw-03-ncbikecrash-")) #> This command will delete the following repositories permanently: 'ghclass-demo/ hw-03-ncbikecrash-ghclass-anya', 'ghclass-demo/hw-03-ncbikecrash-ghclass-bruno', 'ghclass-demo/hw-03-ncbikecrash-ghclass-celine', 'ghclass-demo/hw-03-ncbikecrash- ghclass-diego', 'ghclass-demo/hw-03-ncbikecrash-ghclass-elijah', 'ghclass-demo/hw-03- ncbikecrash-ghclass-francis'. 1: Not now 2: Absolutely 3: No Selection: clean up #> ✔ Deleted repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-anya'. #> ✔ Deleted repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-bruno'. #> ✔ Deleted repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-celine'. #> ✔ Deleted repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-diego'. #> ✔ Deleted repo 'ghclass-demo/hw-03-ncbikecrash-ghclass-elijah'. #> ✔ Deleted repo ‘ghclass-demo/hw-03-ncbikecrash-ghclass-francis'. 2

Slide 37

Slide 37 text

bit.ly/r-git-tree under development

Slide 38

Slide 38 text

bit.ly/r-git-tree auto- mation " ❌ ❓ ❓

Slide 39

Slide 39 text

bit.ly/r-git-tree peer review

Slide 40

Slide 40 text

bit.ly/r-git-tree peer review

Slide 41

Slide 41 text

bit.ly/r-git-tree peer review

Slide 42

Slide 42 text

bit.ly/r-git-tree acknowledgements Colin Rundel University of Edinburgh @rundel Therese Anders University of Southern California @thereseanders

Slide 43

Slide 43 text

R & GitHub sitting in a tree… mine-cetinkaya-rundel cetinkaya.mine@gmail.com @minebocek mine çetinkaya-rundel university of edinburgh & rstudio bit.ly/r-git-tree rundel.github.io/ghclass