Wednesday 24 March 2021

failing

at good enough scientific practice in R

more failures than success

For every \(\varphi\) successes, there are \(\theta\) failures.

Proportion of success

\[ \frac{\varphi}{\varphi + \theta} \]

All trials

\[ \varphi + \theta \]

We often think of science as a function of success

\[ \varphi \sim \text{Binomial}\left( \varphi + \theta,\, \frac{\varphi}{\varphi + \theta}\right) \]

today, let’s talk about \(\theta\)

standard structure

phd in statistical science

\(\color{darkgreen}{\text{mathematics}}\) \(\to\)

code \(\to\)

paper \(\to\)

tool

failing at all the things

the nature of interdisciplinary research

\(\color{darkred}{\times}\) mathematics \(\not\to\)

\(\color{darkred}{\times}\) code \(\not\to\)

\(\color{darkred}{\times}\) paper \(\not\to\)

\(\color{darkred}{\times}\) tool

Good enough scientific programming

failing is the best we can do

at reproducible science

reproducible scientific analysis in R

## # A tibble: 6 x 1
##   sections_in_this_talk                             
##   <chr>                                             
## 1 **.Rmd**-driven development                       
## 2 **functions**                                     
## 3 **documentation** of functions                    
## 4 **git** and version control                       
## 5 **testing** and **workflow** of functions and data
## 6 reproducible **document** for publication

reproducible scientific analysis in R

sections

.Rmd-driven development

functions

documentation of functions

git and version control

testing and workflow of functions and data

reproducible document for publication

for each section

  1. my fails
  2. key resources
  3. your fails

please interrupt

passive and active participation warmly encouraged

CRAPL

the Community Research and Academic Programming License

An open source license for academics has additional needs:

  1. it should require that source and modifications used to validate scientific claims be released with those claims; and
  2. more importantly, it should absolve authors of shame, embarrassment and ridicule for ugly code.

Recommended by @DrVeronikaCH

<>

.Rmd-driven development

failing at

.Rmd-driven development

.Rmd fails

resources

.Rmd fails

tell me your stories

git

failing at git

working on your own

Set up with Happy Git to R

Create repository on GitHub

# pr helpers

pr_init(branch = "idea")

# make changes

# commit

pr_push()

# wait for merge

pr_finish()

git fails

resources

  1. Bryan J. Excuse Me, Do You Have a Moment to Talk About Version Control? The American Statistician. 2018;72(1):20-27. doi:10.1080/00031305.2017.1399928

  2. various. Git - Reference.; 2021. Accessed February 7, 2021. https://git-scm.com/docs

  3. various. GitHub CLI Manual.; 2021. Accessed February 7, 2021. https://cli.github.com/manual/index

  4. Bryan J. Happy Git with R.; 2019. https://happygitwithr.com/resources.html

  5. Pull request helpers • usethis. Accessed March 3, 2021. https://usethis.r-lib.org/articles/articles/pr-functions.html

git fails

tell me your stories

functions and documentation

failing at writing functions and documentation

before

varameta::

simeta::

after

happypillpain

function & documentation fails

resources

function & documentation fails

tell me your stories

testing and workflow

failing at testing and workflow

before

simeta:: tests

after

testing and workflow fails

resources

testing and workflow fails

tell me your stories

todo: get visnet & paper

unexpected perks of failing

code resurrection

network meta-analysis

failing is the best we can do

at reproducible science

If you failed, it means you tried.

You’ll never get everything right in computational science.

Trying is the best you can do. You will fail. You find useful workflows.