Slide 1

Slide 1 text

How R Markdown + Git + GitHub changed my (teaching?) life R Summit & Workshop 2015 Dr. Jennifer (Jenny) Bryan Dept. of Statistics & Michael Smith Laboratories, UBC [email protected] @JennyBryan http://stat545-ubc.github.io @STAT545 http://www.stat.ubc.ca/~jenny/ @jennybc

Slide 2

Slide 2 text

https://github.com/jennybc/2015-06-28_r-summit-talk GitHub repo for this talk gives a bunch of links + PDF of slides

Slide 3

Slide 3 text

http://stat545-ubc.github.io https://github.com/STAT545-UBC/STAT545-UBC.github.io

Slide 4

Slide 4 text

Most years of R use before developing and distributing a package

Slide 5

Slide 5 text

What’s so great about (R) Markdown + Git(Hub)?

Slide 6

Slide 6 text

weak links in the chain: process, packaging and presentation

Slide 7

Slide 7 text

Do your work Get a presentable, web-friendly version for free Present-ability is BAKED IN … not a separate process you never get around to R + markdown

Slide 8

Slide 8 text

stuff you need to write stuff people like to read

Slide 9

Slide 9 text

stuff you need to write stuff people like to read

Slide 10

Slide 10 text

stuff you need to write stuff people like to read foo.R foo.Rmd foo.md foo.html

Slide 11

Slide 11 text

library(rmarkdown) render("foo.Rmd")

Slide 12

Slide 12 text

library(rmarkdown) render("foo.R")

Slide 13

Slide 13 text

foo.Rmd foo.html --- title: "Untitled" output: html_document --- foo.Rmd foo.md foo.html --- title: "Untitled" output: html_document: keep_md: yes --- foo.Rmd foo.md --- output: md_document: variant: markdown_github ---

Slide 14

Slide 14 text

foo.R foo.html #’ — #’ title: "Untitled" #’ output: html_document #’ --- foo.R foo.md foo.html #’ --- #’ title: "Untitled" #’ output: #’ html_document: #’ keep_md: yes #’ --- foo.R foo.md #’ --- #’ output: #’ md_document: #’ variant: markdown_github #’ ---

Slide 15

Slide 15 text

Markdown, and even Rmarkdown, are very privileged on GitHub Essentially rendered as HTML + =

Slide 16

Slide 16 text

When I mark homework ... this is what I see.

Slide 17

Slide 17 text

When I mark homework ... this is what I see.

Slide 18

Slide 18 text

When I mark homework ... this is what I see.

Slide 19

Slide 19 text

What’s so great about (R) Markdown + Git(Hub)?

Slide 20

Slide 20 text

search linky-ness meta-stuff (comments, issues, …) What’s so great about Git(Hub)?

Slide 21

Slide 21 text

Problem: NOTE from R CMD check when testing a package on Travis … but I am specifying my CRAN repo? * checking package dependencies ... NOTE No repository set, so cyclic dependency check skipped Hmm … maybe the CRAN environment variable isn’t consulted, maybe I need to set the CRAN repo set in .Rprofile … how do I that on Travis?

Slide 22

Slide 22 text

Solution: Find a ton of other .travis.yml files that mention .Rprofile!

Slide 23

Slide 23 text

Replies included discussion of why we have isTRUE() and the existence + history of various “truthy” things Included links to where all this occurs in the R source and when it was added

Slide 24

Slide 24 text

https://github.com/wch/r-source/blob/trunk/src/main/util.c#L445-L452 https://github.com/wch/r-source/blob/trunk/src/main/util.c#L123-L129

Slide 25

Slide 25 text

https://github.com/wch/r-source/commit/ 8fee9de69de30815457992145657797bf793b74f#diff- b98c76a66da58d25f4436ff77e8a2ac2R64 Github’s ease of search, navigation, & linking enriched this conversation

Slide 26

Slide 26 text

Are the official examples for a function kind of thin? Search Github to see the function “in the wild”.

Slide 27

Slide 27 text

Are the official examples for a function kind of thin? Search Github to see the function “in the wild”.

Slide 28

Slide 28 text

Github Organization Content, website Shh… secret Discussion forum 1 repo per student

Slide 29

Slide 29 text

Issues as discussion forum

Slide 30

Slide 30 text

Issues to submit, peer review, and mark homework

Slide 31

Slide 31 text

sorry about all those issues!

Slide 32

Slide 32 text

The unreasonable effective of GitHub browsability Commit .md files and figures! They are not like .o files or executables. Get over it.

Slide 33

Slide 33 text

When (intermediate) Markdown is no longer enough … .github.io

Slide 34

Slide 34 text

+ = search linky-ness meta-stuff, e.g. issues reproducible presentable collaboration: “link, don’t attach” machine- and human-readable meta self-documentation