You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found an uninformative error thrown by drake if the plan in plan.R is not assigned to a variable named "plan" or assigned altogether.
This happened by accident just copying over a plan to a new project, and it took me a moment to figure out what was going on. The same error is thrown if you assign the plan to a variable but not named "plan".
Error in if (nrow(plan) < 1L) { : argument is of length zero
Error: callr subprocess failed: argument is of length zero
Type .Last.error.trace to see where the error occured
.Last.error.trace
Stack trace:
Process 99907:
1. (function (r_args = list()) ...
2. drake:::r_make(r_args = r_args)
3. drake:::r_drake(source, drake::make_impl, list(), r_fn, r_args)
4. base:::do.call(r_fn, r_args)
5. (function (func, args = list(), libpath = .libPaths(), repos = default_repos(), ...
6. callr:::get_result(output = out, options)
7. throw(newerr, parent = remerr[[2]])
x callr subprocess failed: argument is of length zero
Process 100517:
19. (function (source, d_fn, d_args) ...
20. base:::source(source)
21. base:::withVisible(eval(ei, envir))
22. base:::eval(ei, envir)
23. base:::eval(ei, envir)
24. drake:::drake_config(plan)
25. drake:::sanitize_plan(plan, envir = envir)
26. base:::.handleSimpleError(function (e) ...
27. h(simpleError(msg, call))
x argument is of length zero
The text was updated successfully, but these errors were encountered:
robitalec
changed the title
Uninformative error
Uninformative error thrown by r_make when plan is not assigned/named "plan"
Oct 14, 2020
The issue is that plan() is a deprecated function in drake and you have not assigned your own object to the symbol plan. It will work if plan.R looks like this:
library(drake)
plan<- drake_plan( # Assign the plan to a variable.printed= print('test')
)
# plan.R
library(drake)
your_plan<- drake_plan( # Assign the plan to a variable.printed= print('test')
)
# _drake.R
source("plan.R")
drake_config(your_plan)
Thanks @wlandau.
The new error message helps point me to double check the drake_plan() assignment, perfect.
Sorry about the confusion for the second note - in haste I swapped the name of the variable to check, but forgot that it is simply whatever the plan is named, passed to drake_config().
Prework
Description
Found an uninformative error thrown by drake if the plan in
plan.R
is not assigned to a variable named "plan" or assigned altogether.This happened by accident just copying over a plan to a new project, and it took me a moment to figure out what was going on.
The same error is thrown if you assign the plan to a variable but not named "plan".Reproducible example
_drake.R
scripts/plan.R
.Last.error.trace
The text was updated successfully, but these errors were encountered: