config_to_metab_clusterfun: Create a function to pass to cluster nodes

View source: R/config_to_metab_clusterfun.R

config_to_metab_clusterfunR Documentation

Create a function to pass to cluster nodes

Description

Returns a self-contained function (closure) with all the necessary information to run config_to_metab or config_to_metab_repeat on computer cluster nodes via clusterApply or clusterApplyLB

Usage

config_to_metab_clusterfun(config, return_value = c("metab_model",
  "file_name", "nothing"), repeat_times = NA, post_metab = TRUE,
  stage_folder = NULL, sb_user, sb_password, verbose = TRUE)

Arguments

config

a data.frame containing the configuration information, or the name of a config file on the computer cluster node.

return_value

character. What should be returned when the function completes? "nothing" may be appropriate for many-model runs or large model objects.

repeat_times

either NA for no repetition, or an integer number of times to repeat the fit for each config row (using config_to_metab_repeat)

post_metab

logical. Should the metab model be staged and posted?

stage_folder

character. The folder name on the computer cluster node where the metab_model should be staged before posting (only applies if post_metab=TRUE). If NULL, the local tempdir() will be used.

sb_user

the ScienceBase username, only used if post_metab=TRUE

sb_password

the ScienceBase password, only used if post_metab=TRUE

verbose

logical. Should status messages be given?

Examples

## Not run: 
# might need to run this before calling clusterApplyLB, but might work all in one line
clusterApplyLB(c1, 1:nrow(config), config_to_metab_clusterfun(config, rows))

## End(Not run)

USGS-R/mda.streams documentation built on June 3, 2023, 8:43 a.m.