R and GitHub sitting in a tree...

R and GitHub sitting in a tree...

ITiCSE 2019 GitHub Education talk. Aberdeen, Scotland.

81689b093f75cf3f383e581ca57188df?s=128

Mine Cetinkaya-Rundel

July 15, 2019
Tweet

Transcript

  1. 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
  2. bit.ly/r-git-tree context

  3. 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
  4. 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
  5. 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
  6. bit.ly/r-git-tree infrastructure " instructor # student

  7. bit.ly/r-git-tree language integrated development environment literate programming version control collaboration,

    publishing, course management # student
  8. 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]
  9. bit.ly/r-git-tree " instructor + ghclass R package of tools for

    managing GitHub class organization accounts
  10. 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.
  11. bit.ly/r-git-tree the whole game

  12. bit.ly/r-git-tree 00. create course roster " instructor #> # A

    tibble: 6 x 4 #> uid email ghname team #> <chr> <chr> <chr> <chr> #> 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
  13. bit.ly/r-git-tree 01. create assignment " instructor

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

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

  16. 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
  17. bit.ly/r-git-tree 03. create student repos " instructor

  18. 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
  19. 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
  20. bit.ly/r-git-tree 05. work on assignment # student

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

  22. bit.ly/r-git-tree git

  23. bit.ly/r-git-tree diff viewer

  24. bit.ly/r-git-tree commit

  25. bit.ly/r-git-tree push

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

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

  28. bit.ly/r-git-tree tooling

  29. 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]
  30. 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
  31. bit.ly/r-git-tree teams

  32. bit.ly/r-git-tree teams

  33. 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
  34. bit.ly/r-git-tree styler

  35. bit.ly/r-git-tree styler

  36. 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
  37. bit.ly/r-git-tree under development

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

  39. bit.ly/r-git-tree peer review

  40. bit.ly/r-git-tree peer review

  41. bit.ly/r-git-tree peer review

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

    University of Southern California @thereseanders
  43. 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