if (FALSE) {
# Not run:
# Simple example
my_simulation <- function(i, param) {
out_file <- sprintf("results/sim_%04d.Rds", i)
if (file.exists(out_file)) return()
result <- run_simulation(i, param)
saveRDS(result, out_file)
}
# Run 100 simulations on HPC
tq_apply(
n = 100,
fun = my_simulation,
project = "my_study",
resource = "hpc",
memory = 16,
hour = 6,
param = 5
)
# Monitor progress
project_status("my_study")
task_status("my_study")
}
Run the code above in your browser using DataLab