,
see what your Makefile
recipes
will look like in advance. — Makefile_recipe" />
make(..., parallelism = "Makefile")
,
see what your Makefile
recipes
will look like in advance.R/recipe.R
Relevant to "Makefile"
parallelism only.
Makefile_recipe(recipe_command = drake::default_recipe_command(), target = "your_target", cache_path = drake::default_cache_path())
recipe_command | The Makefile recipe command.
See |
---|---|
target | character scalar, name of your target |
cache_path | path to the drake cache.
In practice, this defaults to the hidden |
A character scalar with a Makefile recipe.
Makefile recipes to build targets are customizable.
Use the Makefile_recipe()
function to show and tweak
Makefile recipes in advance, and see
default_recipe_command()
and
r_recipe_wildcard()
for more clues.
The default recipe is Rscript -e 'R_RECIPE'
, where
R_RECIPE
is the wildcard for the recipe in R for making the target.
In writing the Makefile, R_RECIPE
is replaced with something like
drake::mk("name_of_target", "path_to_cache")
.
So when you call
make(..., parallelism = "Makefile", recipe_command = "R -e 'R_RECIPE' -q")
, # nolint
from within R, the Makefile
builds each target
with the Makefile
recipe,
R -e 'drake::mk("this_target", "path_to_cache")' -q
.
But since R -q -e
fails on Windows,
so the default recipe_command
argument is
"Rscript -e 'R_RECIPE'"
(equivalently just "Rscript -e"
),
so the default Makefile
recipe for each target is
Rscript -e 'drake::mk("this_target", "path_to_cache")'
.
default_recipe_command()
,
r_recipe_wildcard()
, make()
# Only relevant for "Makefile" parallelism. # Show an example Makefile recipe. Makefile_recipe(cache_path = "path") # `cache_path` has a reliable default.#># Customize your Makefile recipe. Makefile_recipe( target = "this_target", recipe_command = "R -e 'R_RECIPE' -q", cache_path = "custom_cache" )#>default_recipe_command() # "Rscript -e 'R_RECIPE'" # nolint#> [1] "Rscript -e 'R_RECIPE'"r_recipe_wildcard() # "R_RECIPE"#> [1] "R_RECIPE"# NOT RUN { test_with_dir("Quarantine side effects.", { load_basic_example() # Get the code with drake_example("basic"). # Look at the Makefile generated by the following. # make(my_plan, paralleliem = "Makefile") # Requires Rtools on Windows. # nolint # Generates a Makefile with "R -q -e" rather than # "Rscript -e". # Be aware the R -q -e fails on Windows. # make(my_plan, parallelism = "Makefile", jobs = 2, # nolint # recipe_command = "R -q -e") # nolint # Same thing: clean() # Start from scratch. # make(my_plan, parallelism = "Makefile", jobs = 2, # nolint # recipe_command = "R -q -e 'R_RECIPE'") # nolint clean() # Start from scratch. # make(my_plan, parallelism = "Makefile", jobs = 2, # nolint # recipe_command = "R -e 'R_RECIPE' -q") # nolint }) # }