$30 off During Our Annual Pro Sale. View Details »

R and GitHub sitting in a tree...

R and GitHub sitting in a tree...

ITiCSE 2019 GitHub Education talk. Aberdeen, Scotland.

Mine Cetinkaya-Rundel

July 15, 2019
Tweet

More Decks by Mine Cetinkaya-Rundel

Other Decks in Education

Transcript

  1. R & GitHub
    sitting in a tree…
    mine-cetinkaya-rundel
    [email protected]
    @minebocek
    mine çetinkaya-rundel
    university of edinburgh & rstudio
    bit.ly/r-git-tree

    View Slide

  2. bit.ly/r-git-tree
    context

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

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

    View Slide

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

    View Slide

  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]

    View Slide

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

    View Slide

  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.

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  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

    View Slide

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

    View Slide

  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

    View Slide

  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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  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]

    View Slide

  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

    View Slide

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

    View Slide

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

    View Slide

  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

    View Slide

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

    View Slide

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

    View Slide

  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

    View Slide

  37. bit.ly/r-git-tree
    under development

    View Slide

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



    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide