Questions tagged [drake-r-package]

The drake R package is a Make-like pipeline toolkit. Its purpose is to enhance reproducibility, automation, speed, and scale in R-focused data science workflows. Use this tag for general questions about usage or for help optimizing and debugging drake-powered projects. For bug reports and feature requests, please post to the GitHub issue tracker.

Visit the following to learn more about the drake R package.

85 questions
0
votes
1 answer

How to create a plan in a function

I'd like to use a function to create a drake plan. See MWE: plan_func <- function(param) { drake::drake_plan( myparam = param ) } I would like plan_func("a") to give # A tibble: 1 x 2 target command 1 myparam…
0
votes
1 answer

Is it possible to split subtargets from a dynamic branching target such that later dynamic branching targets get just one subsubtarget?

I have a plan like: plan = drake::drake_plan( targ1 = target( f1(input) , dynamic = map(input) ) , targ2 = target( f2(targ1) , dynamic = map(targ1) ) ) Where the function f1 actually yields multiple…
Mike Lawrence
  • 1,641
  • 5
  • 20
  • 40
0
votes
1 answer

How to use shiny app as a target in drake

How to pass previous target (df) to ui and server functions that I use in the next command shinyApp. My plan looks like this: plan <- drake_plan( df = faithful, app = shinyApp(ui, server) ) ui and server are copied from the shiny tutorial.…
mihagazvoda
  • 1,057
  • 13
  • 23
0
votes
1 answer

dynamic branching: Define the order of targets into single plan

Reading the documentation of the drake package, I found no other way to define the order of the targets without the use of 'file_in' and 'file_out'. file_in() marks individual files (and whole directories) that your targets depend on. file_out()…
0
votes
1 answer

Best practices for drake pipeline experimentation

I'm new to drake but loving it so far. One thing I'm having trouble with is how to best go about experimenting with different pipeline configurations. That is, my plans consist purely of a chain of targets where the output from the first target is…
Mike Lawrence
  • 1,641
  • 5
  • 20
  • 40
0
votes
1 answer

drake static branching: How to use .id within map() to increase visibility of dependency graph

I am using a drake workflow to process ~100 files which are stored in a location with very long file names. These long file names make the dependency graph hard to read. Here is a minimal example: # example setup library(drake) very_long_path <-…
der_grund
  • 1,898
  • 20
  • 36
0
votes
1 answer

Using code_to_plan and target(..., format = "fst") in drake

I really like using the code_to_plan function when constructing drake plans. I also really using target(..., format = "fst") for big files. However I am struggling to combine these two workflows. For example if I have this _drake.R file: # Data…
boshek
  • 4,100
  • 1
  • 31
  • 55
0
votes
1 answer

Is there a way to change the absolute path of file_in inputs to drake without invalidating downstream targets?

For my project, sometimes restructuring, or simply changing the mount point of my project data directory is required (Eg - Upgrading to catalina and no longer being able to have non-standard subdirectories of / ) . I've noticed that, even though…
0
votes
1 answer

Progress bar within drake functions

I'm trying to implement progress bars within function for use in a drake-r project. I am using the progress package for the progress_bar R6 class. The following example produces the expected progress…
mpschramm
  • 520
  • 6
  • 12
0
votes
0 answers

Customizing {drake} plan with {data.table}

My goal is to customize {drake} plan to reduce duplication of codes for both simple and complex cases, for example, setting drake::trigger for multiple targets based on specific conditions of the plans (ie programmatically identify the targets to be…
kar9222
  • 391
  • 3
  • 5
0
votes
1 answer

How can I replace a failed target with a missing value?

I am fitting a bunch of models using a drake plan. Some of them are failing due to problems in the initialization. I am running `make(plan, keep_going = T) in order to finish the plan in anyway, but what I would really like is to be able to skip the…
lordbitin
  • 185
  • 1
  • 9
0
votes
1 answer

drake: how to send arguments to target with combine?

Consider the following MWE. How do I get the m1 and m2 integers instead of expressions to be exposed to the func() arguments, instead of "object '1' not found"? func <- function(x, m1, m2) { paste("M1=", m1, "M2=", m2, ": ", mean(unlist(x))) } p…
adamski
  • 71
  • 6
0
votes
1 answer

Using an external file change as trigger

I'm using drake to orchestrate a workflow where if an external shiny app (stored in project_dir/shiny/app.R) changes, I want to trigger a docker build. shiny_plan <- drake_plan( docker_build = system(command = "docker build shiny/. -t…
Rahul
  • 2,579
  • 1
  • 13
  • 22
0
votes
1 answer

How to manage global variable warnings from a function that create a drake plan in package?

I created a package to organise my files for an analysis workflow using {drake}. One function creates the Drake plan. This function is called in _drake.R to run the analysis with r_make(). So far so good everything works, I can change some paths and…
Jean
  • 15
  • 7
0
votes
3 answers

How can I import from multiple files in r-drake?

I want to import data of a similar category from multiple source files. Every source has a short label. How can I incorporate this into drake, without writing out every file as its own target? I thought the following would work, but it does not.…
robust
  • 594
  • 5
  • 17