REPROdUCIBLE {{ ANALYSIS }} IN R

Safa Andac

 

GENERATING REPORTS IN R

Safa Andac

 

x100??

Expectation

x1

Reality

x10

openclipart.com

WRITING CODE AT FIRST

Import

Tidy

Transform

Model

Visualize

Communicate

Exploration

WORKFLOW

Import

Tidy

Transform

Model

Visualize

Communicate

Exploration

WORKFLOW

Import

Tidy

Transform

Model

Visualize

Communicate

Exploration

WORKFLOW

DILEMMA

Reproduce or Save Time?

openclipart.com

ALL FOR ONE

divide.R

and.R

conquer.R

the.R

world.R

  • Time Saver
  • Easier to Debug
  • Reproducibility comes at a cost
  • Responsible for the code base

ONE FOR ONE

conquer_the_world.R

  • Time Consuming
  • Hard to Debug
  • Reproducible (generally)
  • Responsible for one file

~x500

SOLUTION

Use a pipeline tool

  • Time Saver
  • Keeps tracks of changes
  • Supports reproducilibity

SOLUTION

Imperative Scripts

Embrace Functions!

SOLUTION

Workflow as a list of targets

tar_visnetwork()

SOLUTION

tar_visnetwork()
tar_make()

SOLUTION

Build the pipeline gradually:

  • Add target
  • Run Pipeline
  • Inspect New Targets
  • Repeat

ONE MORE THING

Option 1 (?)

Option 2

Option 3

EMBRACE THE EMBRACE!

References

  • https://github.com/ropensci/targets
  • https://wlandau.github.io/targets-tutorial
  • https://github.com/tidyverse/tidyverse
  • https://rlang.r-lib.org/reference/topic-data-mask.html
  • https://rlang.r-lib.org/reference/topic-data-mask-programming.html
Made with Slides.com