Slide 1

Slide 1 text

ANYONE CAN PLAY GIT/R KARA WOO | @KARA_WOO RESEARCH SCIENTIST, SAGE BIONETWORKS CASCADIA R CONFERENCE Tips for First-Time Contributions to R Packages

Slide 2

Slide 2 text

Photo: Asa Rodger THE STRUGGLE IS REAL

Slide 3

Slide 3 text

Photo: Elaine Casap

Slide 4

Slide 4 text

Photo: Asa Rodger

Slide 5

Slide 5 text

Photo: Andrew Seaman

Slide 6

Slide 6 text

diverse fields

Slide 7

Slide 7 text

DAY 1

Slide 8

Slide 8 text

TODAY Memeification: David Ho

Slide 9

Slide 9 text

R package landscape • Over 12,000 packages on CRAN • Plus Bioconductor, GitHub, etc.

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

Photo: Sebastian Lengauer

Slide 12

Slide 12 text

ggplot2

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

WHY SHOULD I CONTRIBUTE TO R PACKAGES?


Slide 15

Slide 15 text

Why contribute? • Make things work the way you want

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

Photo: Ciprian Lipenschi

Slide 20

Slide 20 text

Photo: Paul Frenzel

Slide 21

Slide 21 text

Photo: Delaney Dawson

Slide 22

Slide 22 text

Open issues 
 on GitHub

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

REPREX minimal reproducible example

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

reprex()

Slide 28

Slide 28 text

``` 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).

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

Photo: Sarah Dorweiler

Slide 32

Slide 32 text

GITHUB ISSUES provide a reproducible, clean, parsimonious argument that this is a real problem worth fixing

Slide 33

Slide 33 text

Survey existing issues on GitHub

Slide 34

Slide 34 text

Survey existing issues • Answer questions • (Re)produce reprexes • Add information

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

Improve documentation

Slide 38

Slide 38 text

#' 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 }

Slide 39

Slide 39 text

Documentation fixes • Typos • Confusing stuff • Out of date or inaccurate information • Examples

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

Photo: Kawtar Cherkaoui

Slide 42

Slide 42 text

Fix a bug!

Slide 43

Slide 43 text

Contributing code • Start with an issue

Slide 44

Slide 44 text

good first issue help wanted

Slide 45

Slide 45 text

Photo: Olloweb Solutions BECOMING A BUG DETECTIVE

Slide 46

Slide 46 text

Photo: Annie Spratt

Slide 47

Slide 47 text

Photo: Jack Hunter

Slide 48

Slide 48 text

traceback() Photo: Ryan Fields

Slide 49

Slide 49 text

Photo: Bernard Hermant debug()

Slide 50

Slide 50 text

Photo: Filip Mroz

Slide 51

Slide 51 text

Bug hunting tips • Read the function(s) • Find the surrounding functions • traceback() and debug() are your friends

Slide 52

Slide 52 text

Contributing code • Start with an issue

Slide 53

Slide 53 text

Contributing code • Start with an issue • Submit a pull request containing your change

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

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

Slide 56

Slide 56 text

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

Slide 57

Slide 57 text

Photo: Antony Xia

Slide 58

Slide 58 text

START SMALL AND LEARN AS YOU GO You don’t need to be an expert to contribute through issues, comments, reprexes, documentation, or code

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

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/

Slide 61

Slide 61 text

Photo: Agathe Marty

Slide 62

Slide 62 text

Photo: Tom Johnson thanks! Acknowledgements: Thanks to Mara Averick, Tom Johnson, Sean Kross, Ross Donaldson, Hadley Wickham, 
 R-Ladies Seattle, and #rcatladies