Anyone Can Play Git/R: Tips for First-Time Contributions to R Packages

Anyone Can Play Git/R: Tips for First-Time Contributions to R Packages

Contributing to R packages and projects can be a rewarding way to give back to the tools you use and to improve your own programming skills in the process. In this talk, Kara will discuss some of the varied ways to contribute to existing projects. Anyone, whether a seasoned programmer or someone brand new to R, can make useful contributions to R packages. Kara will draw on her experience working on ggplot2 to offer strategies for finding your way in an unfamiliar codebase, and to give insights into the relationship between maintainers and contributors.

1548a7c3c4273ded4ca2bd765548a370?s=128

Kara Woo

June 02, 2018
Tweet

Transcript

  1. ANYONE CAN PLAY GIT/R KARA WOO | @KARA_WOO RESEARCH SCIENTIST,

    SAGE BIONETWORKS CASCADIA R CONFERENCE Tips for First-Time Contributions to R Packages
  2. Photo: Asa Rodger THE STRUGGLE IS REAL

  3. Photo: Elaine Casap

  4. Photo: Asa Rodger

  5. Photo: Andrew Seaman

  6. diverse fields

  7. DAY 1

  8. TODAY Memeification: David Ho

  9. R package landscape • Over 12,000 packages on CRAN •

    Plus Bioconductor, GitHub, etc.
  10. None
  11. Photo: Sebastian Lengauer

  12. ggplot2

  13. None
  14. WHY SHOULD I CONTRIBUTE TO R PACKAGES?


  15. Why contribute? • Make things work the way you want

  16. Why contribute? • Make things work the way you want

    • Opportunities, jobs, collaborations
  17. Why contribute? • Make things work the way you want

    • Opportunities, jobs, collaborations • Teach
  18. Why contribute? • Make things work the way you want

    • Opportunities, jobs, collaborations • Teach • Learn
  19. Photo: Ciprian Lipenschi

  20. Photo: Paul Frenzel

  21. Photo: Delaney Dawson

  22. Open issues 
 on GitHub

  23. None
  24. None
  25. REPREX minimal reproducible example

  26. library("ggplot2") ggplot(mtcars, aes(wt, mpg)) + geom_point()

  27. reprex()

  28. ``` r library("ggplot2") ggplot(mtcars, aes(wt, mpg)) + geom_point() ``` ![](https://i.imgur.com/Ymw2m1B.png)

    Created on 2018-05-18 by the [reprex package](http://reprex.tidyverse.org) (v0.2.0).
  29. None
  30. None
  31. Photo: Sarah Dorweiler

  32. GITHUB ISSUES provide a reproducible, clean, parsimonious argument that this

    is a real problem worth fixing
  33. Survey existing issues on GitHub

  34. Survey existing issues • Answer questions • (Re)produce reprexes •

    Add information
  35. None
  36. None
  37. Improve documentation

  38. #' Add two numbers #' #' @param x The first

    nubmer #' @param y The second number #' @return The sum of the first #' and second number #' #' @examples #' add(2, 2) add <- function(x, y) { x + y }
  39. Documentation fixes • Typos • Confusing stuff • Out of

    date or inaccurate information • Examples
  40. None
  41. Photo: Kawtar Cherkaoui

  42. Fix a bug!

  43. Contributing code • Start with an issue

  44. good first issue help wanted

  45. Photo: Olloweb Solutions BECOMING A BUG DETECTIVE

  46. Photo: Annie Spratt

  47. Photo: Jack Hunter

  48. traceback() Photo: Ryan Fields

  49. Photo: Bernard Hermant debug()

  50. Photo: Filip Mroz

  51. Bug hunting tips • Read the function(s) • Find the

    surrounding functions • traceback() and debug() are your friends
  52. Contributing code • Start with an issue

  53. Contributing code • Start with an issue • Submit a

    pull request containing your change
  54. None
  55. Contributing code • Start with an issue • Submit a

    pull request containing your change • Update documentation • Tests prevent your fix from getting un-fixed • Follow code style
  56. Contributing code • Start with an issue • Submit a

    pull request containing your change • Update documentation • Tests prevent your fix from getting un-fixed • Follow code style • CONTRIBUTING.md
  57. Photo: Antony Xia

  58. START SMALL AND LEARN AS YOU GO You don’t need

    to be an expert to contribute through issues, comments, reprexes, documentation, or code
  59. None
  60. More resources • “Contributing Code to the Tidyverse” by Jim

    Hester 
 http:/ /www.jimhester.com/2017/08/08/contributing/ • “Contributing to Tidyverse Packages” by Mara Averick
 https:/ /www.rstudio.com/resources/videos/contributing-to- tidyverse-packages/ • “Happy Git and GitHub for the useR” by Jenny Bryan
 http:/ /happygitwithr.com/
  61. Photo: Agathe Marty

  62. Photo: Tom Johnson thanks! Acknowledgements: Thanks to Mara Averick, Tom

    Johnson, Sean Kross, Ross Donaldson, Hadley Wickham, 
 R-Ladies Seattle, and #rcatladies