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
2
votes
1 answer

Remove loaded drake cache objects from RAM

I've run a plan to create a large set of objects in drake's cache. Now, outside of a plan, I ran lapply over a subset of those objects so I can summarize some of their properties and plan my next steps. I'm using readd to load each one of these…
rushgeo
  • 103
  • 6
2
votes
1 answer

How to refer to previous targets in drake?

I would like to use the wildcard to generate a bunch of targets, and then have another set of targets that refers to those original targets. I think this example represents my idea: plan <- drake_plan( sub_task = runif(1000, min = mean__, max =…
ldecicco
  • 883
  • 8
  • 16
2
votes
2 answers

Generate workflow plan for all combinations of inputs in Drake?

I'm trying to create a workflow plan that will run some function my_function(x, y) for all combination of inputs in my_dataset but am stuck as to how to to generate the commands for drake's workflow without using paste.…
pedram
  • 2,931
  • 3
  • 27
  • 43
2
votes
1 answer

R drake file out name with variable

I am using drake to create multiple output files, where I want to specify the path by a variable. Something like outpath <- "data" outfile <- file.path(outpath, "mydata.csv") write.csv(df, outfile) But file_out doesn't seem to work with arguments…
David
  • 9,216
  • 4
  • 45
  • 78
1
vote
0 answers

Using target to make a drake-plan: error_handling in R

I have made a plan with drake_plan() using the drake package. here is a target I have made: tables_weighted_pat = make_weights( x = dat_pat$data, struc = dat_pat$struc, start_vars = start_vars, display_values =…
Hellihansen
  • 163
  • 6
1
vote
1 answer

How to relate a drake dynamic subtarget to the actual dataframe / source target?

The drake manual gives the following example of using dynamic subtargets: https://books.ropensci.org/drake/dynamic.html#dynamic-transformations library(gapminder) library(drake) plan <- drake_plan( subset = head(gapminder), row = target(subset,…
Mark Payne
  • 557
  • 5
  • 12
1
vote
1 answer

Why can't I use ls() in a drake R plan?

I'm trying to list all objects/variables/dataframes in a drake plan's environment that match a certain condition. However, when I try to use ls() for this, I'm returned an error. How could I do this instead?
Will M
  • 692
  • 9
  • 20
1
vote
1 answer

How to use dynamic files to update drake directory

I want to make sure that my drake plan will update when I add new .csv files to a directory. I looked into the new dynamic files, but couldn't get this to work (see…
shir
  • 51
  • 6
1
vote
3 answers

Clean up memory in Drake workflow R

I have package a massive time series workflow (4273*10 models) for 4273 time series weekly in drake. Originally I attempted to create the full workflow using the fable package. Which is quite handy to train models for grouped tsibbles, but after…
tfkLSTM
  • 161
  • 13
1
vote
1 answer

Best practice for multiple subplans in drake R

Hi I am new to the drake R package and would like to hear some opinions on best practice in using subtasks to manage a large project. A simplified structure of my project has two parts: 1) data cleaning and 2) modeling. They are cascaded in the…
Kallas
  • 69
  • 5
1
vote
1 answer

Using rvest with drake: external pointer is not valid error

When I first run the code below, everything is ok. But when I change something in html_file %>%... comand, for example commenting tolower(), I get the following error: Error: target title failed. diagnose(title)error$message: external pointer is…
mihagazvoda
  • 1,057
  • 13
  • 23
1
vote
1 answer

Treating a function as data (As in, bundling a function with a dataset) - Best approach

I have a workflow that I run against variations of essentially the same dataset (It's an emr extract, sometimes I run against iterations of the bulk extract, and sometimes against iterations of test extracts). These datasets are (Supposed to be)…
1
vote
1 answer

Correct usage of drake::expose_imports() - Where to place call - Is it recursive?

Summary I've noticed hints/suggestions/warnings in the drake docs suggesting use of expose_imports to ensure that changes in imported packages are tracked reproducibly, but the docs are relatively brief on the correct usage of this. Example I've now…
1
vote
1 answer

R {drake}: how to clone a .drake folder from one computer to another?

I successfully ran a complex workflow on a remote computer. On there I can check that all is up to date and explore the results without problem. I would like to move the .drake folder to my local computer so I can explore the results more…
1
vote
1 answer

R {drake} plan: Read many datasets into single target

I started to use {drake} for a data production pipeline. The raw data I work with is quite large and is split up into ~130 separate (Stata) files. Thus, each file should be processed separately. In order to keep it readable, I use target(),…
der_grund
  • 1,898
  • 20
  • 36