Create parameter grid for job submission
grid.RdGenerate a grid of parameter combinations for parameter sweeps, compatible with slurm_pmap for parallel execution.
Examples
# \donttest{
# Simple parameter grid
params <- grid(
alpha = c(0.1, 0.5, 1.0),
beta = c(1, 2),
method = c("lm", "glm")
)
# Creates 3 * 2 * 2 = 12 combinations
# With filtering
params <- grid(
x = 1:3,
y = 1:3,
.filter = ~ .x <= .y # Only upper triangle
)
# Use with slurm_pmap (local engine for examples)
if (interactive()) {
jobs <- slurm_pmap(params, function(x, y, method, ...) {
# Run analysis with these parameters
x + y
}, .engine = "local")
}
# }