Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro...

35
Introduction to markdown and git Rebecca C. Steorts Predictive Modeling: STA 521 August 27 2015 1

Transcript of Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro...

Page 1: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

Introduction to markdown and git

Rebecca C. SteortsPredictive Modeling: STA 521

August 27 2015

1

Page 2: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

Today’s Menu

1. What is reproducible research?

2. What is Markdown?

3. What is git and bitbucket?

2

Page 3: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

What is reproducible research?

Reproducible research is the idea that data analyses, and moregenerally, scientific claims, are published with their data andsoftware code so that others may verify the findings and buildupon them.-Johns Hopkins, Coursera

3

Page 4: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

What is reproducible research?

4

Page 5: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

A Case Study

5

Page 6: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

A Case Study

6

Page 7: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

I How did such papers pass peer review?

I How would you reproduce such results without their data ortheir code?

I Suggestion: At the time of publication, researchers makeenough material openly available (data, programs, narrative)so that other researchers in the field can replicate their work.

I At the very least, this sets a standard not just for academiabut for things in house in industry.

7

Page 8: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

Research and Education

[Credit: Jenny Bryan]8

Page 9: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

RStudio

[Credit: Jenny Bryan]9

Page 10: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

RStudio

[Credit: Jenny Bryan]10

Page 11: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

11

Page 12: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

Markdown

[Credit: Jenny Bryan]12

Page 13: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

Markdown

[Credit: Jenny Bryan]13

Page 14: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

Markdown

[Credit: Jenny Bryan]14

Page 15: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

Markdown

[Credit: Jenny Bryan]15

Page 16: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

Pandoc

[Credit: Jenny Bryan]16

Page 17: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

Markdown

[Credit: Jenny Bryan]17

Page 18: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

R Markdown

You can include bits of R code in Markdown. Let’s see how itworks!

18

Page 19: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

R Markdown

19

Page 20: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

R Markdown

20

Page 21: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

R Markdown

21

Page 22: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

R Markdown

22

Page 23: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

R Markdown

23

Page 24: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

R Markdown

24

Page 25: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

R Markdown

25

Page 26: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

R Markdown

26

Page 27: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

R Markdown

27

Page 28: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

R Markdown

28

Page 29: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

R Markdown

29

Page 30: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

Homework 1

I Your first homework can be found athttps://stat.duke.edu/~rcs46/labsANDhw.html

I Note that you must complete this in Markdown and you mustsubmit this through the Sakai website.

I The homework is due Monday, August 31 at 11:59 PM.

I Over the weekend, please also install bitbucket and git (usingthe instructions below).

I Please also complete the reading on git. There will be noreading for Tuesday’s class.

30

Page 31: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

Sometimes we need a little organization!

31

Page 32: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

Version Control

Version control are tools that allow individuals or groups to worksimultaneously on the same project.

I Mastering a version control system is vital to easilycollaborate with others, and is useful even for solo workbecause it allows you to easily undo mistakes.

I You can use it in combo with RStudio. For more, seehttp://r-pkgs.had.co.nz/intro.html.

32

Page 33: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

Git

Git is a version control system.

I It’s a tool that tracks changes to your code and shares thosechanges with others.

I Git is most useful when combined with GitHub or Bitbucket, awebsite that allows you to share your code with the world,solicit improvements via pull requests and track issues.

33

Page 34: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

Why Git + Git (Bitbucket)

I Sharing packages and programs is easy. Any R user can installyour package via:

install.packages("devtools")

devtools::install_github("username/packagename")

I It’s a great way to maintain reproducible research that otherscan report suggestions or bugs on.

I It’s nice for collaborative or team projects so you don’t haveto share code via Dropbox or email.

I You can also undo and spot mistakes easily and track thesedown.

34

Page 35: Introduction to markdown and git - Statistical Sciencercs46/lectures_2015/01-markdown-git/01-intro … · Git Git is a version control system. I It’s a tool that tracks changes

Basic set up and commands

We’ll now move to my webpage so we can look at basic set up andcommands. https://stat.duke.edu/~rcs46/git.html

35