reprex: help me help you!

reprex: help me help you!

reprex R package: description and philosophy
http://jennybc.github.io/reprex/
part of rOpenSci Community Call 2017 March 7
https://github.com/ropensci/commcalls/issues/14

0a4f62e90c976eeb44d33add75cca5af?s=128

Jennifer (Jenny) Bryan

March 07, 2017
Tweet

Transcript

  1. 1.

      Jennifer Bryan 
 RStudio, University of British Columbia

    @JennyBryan @jennybc reprex: the package, the point
  2. 2.

    How to ask questions so they get answered! Possibly by

    yourself! 2017 March 07 w/ James (JD) Long, Jenny Bryan, Scott Chamberlain an rOpenSci Community call: https://github.com/ropensci/commcalls/issues/14 Collaborative notes: http://bit.ly/commcallv13
  3. 3.
  4. 5.

    conversations about code are more productive when they contain code

    code that actually runs code that I don’t have to run code that I can easily run
  5. 8.
  6. 9.

    code that actually runs code is run in separate, fresh

    R session ergo, it must be self-contained! must load all necessary packages must create all necessary objects
  7. 11.

    code that I don’t have to run did I mention:

    I touch 300 - 500 issues/course? I can often get the point w/o running code IFF I can see the output SHOW ME SOME OUTPUT, not just the code
  8. 12.
  9. 13.

    code that I can easily run do not copy/paste your

    R transcript do not take a screenshot of your R session must I edit out the prompts? must I comment the output? HELP ME HELP YOU
  10. 14.

    > library(purrr) > x <- list(one = list(always = "a",

    sometimes = "b"), + two = list(always = "b", sometimes = NULL)) > x %>% map_chr("always") one two "a" "b" > x %>% map_chr("sometimes") Error: Result 2 is not a length 1 atomic vector
  11. 15.

    library(purrr) x <- list(one = list(always = "a", sometimes =

    "b"), two = list(always = "b", sometimes = NULL)) x %>% map_chr("always") #> one two #> "a" "b" x %>% map_chr("sometimes") #> Error: Result 2 is not a length 1 atomic vector
  12. 16.
  13. 17.

    basic copy + reprex() copy + add-in select or focus

    + add-in venue = “so”, venue= “R” si = TRUE input, outfile include a figure reprex_invert() reprex_clean() reprex_rescue() stuff I hope to show
  14. 21.

    writing a good reprex can seem like a hassle but

    if asker can’t be bothered, why should the answerer? practice this often and it will make you a better programmer it will increase your knowledge of the language
  15. 22.

    writing a reprex helps you ambush your problem from behind

    “demonstrate my problem in a small example” sounds so much more doable than “figure out how my code is borked” > x% of the time I solve my own problem, but the reprex mentality is enabling
  16. 23.