drake (version 6.2.1)

do_prework: Do the prework in the prework argument to make().

Description

For internal use only. The only reason this function is exported is to set up parallel socket (PSOCK) clusters without too much fuss.

Usage

do_prework(config, verbose_packages)

Arguments

config

internal configuration list

verbose_packages

logical, whether to print package startup messages

Value

Inivisibly returns NULL.

Examples

Run this code
# NOT RUN {
test_with_dir("Quarantine side effects.", {
load_mtcars_example() # Get the code with drake_example("mtcars").
# Create a master internal configuration list with prework.
con <- drake_config(my_plan, prework = c("library(knitr)", "x <- 1"))
# Do the prework. Usually done at the beginning of `make()`,
# and for distributed computing backends like "future_lapply",
# right before each target is built.
do_prework(config = con, verbose_packages = TRUE)
identical(x, 1) # Should be TRUE.
})
# }

Run the code above in your browser using DataCamp Workspace