In the above link, the last code snippet shows the following:
num_pcs <- 3
recipe(mpg ~ ., data = mtcars) %>%
# Bad since num_pcs might not be found by a worker process
step_pca(all_predictors(), num_comp = num_pcs)
recipe(mpg ~ ., data = mtcars) %>%
# Good since the value is injected into the object
step_pca(all_predictors(), num_comp = !!num_pcs)
In this case, does !! make the R's command invoked/recognised by all the parallel cores and their respective threads as an orchestrated task instead of creating 3 of their own PCAs per core (totalling 9 perhaps? If so, who knows how garbage collection is handled)? So ultimately, the output will be realised as intended.
Either way, how do we know when to use !!? Would such methods be necessary for vfold_cv, grid, or any other steps of the modelling process?