CM.run: Run the full stack of the main cmgo functions

Description Usage Arguments Details Value Author(s) Examples

View source: R/CM.run.r

Description

This function is a wrapper function for the main functions of the package cmgo. With no parameters passed, it initializes the global data object containing the demo data set and the default parameters. It returns the global data object - as all main function do - which can be used for further execution of the program. If your global data object already exists, you can pass this to CM.run() to execute all main functions at once. Alternatively, you can call CM.run() with a parameter object or a file name of a parameter configuration (see CM.par() for further information.)

Usage

1
CM.run(object = NULL, par = NULL)

Arguments

object

Possible values include NULL and the global data object.

par

Possible values include NULL, filename or list of parameters. If par is not specified or NULL the default parameters are used (see documentation of CM.par() to learn about the default parameters). If par is a filename CM.ini() will try to open that file and look for a list par in that file. In case of success the parameters from that file are loaded and merged with the default parameters. Merging means, not all parameters have to be defined in the parameter file. Parameters that are not defined are taken from the default. In case par is a list, the default parameters are merged with this list. That means, if the actual parameters are handed over to CM.ini() - e.g. global_data_object$par - the parameters will be passed through.

Details

CM.run represents a wrapper function of the main cmgo functions with the following code:

1
2
3
4
5
6

You can use CM.run() either for demo purposes (just call CM.run() without parameters) or to start a new project from scratch. To do this, make sure you have read about the input data preparation in the documentation of CM.ini(). If you are familiar with the input data preparation just call CM.run() while you place your valid input files to the specified input directory (defaults to "./input").

Value

The global data object containing data ($data) and parameters ($par). The global data object must be passed to all main functions of cmgo.

Author(s)

Antonius Golly

Examples

1
2
3
4
5
6
7
# example 1: open with demo data and default parameters
cmgo.obj = CM.run()

# example 2: re-create global data object with updated parameters
#parameter_file = "par/new_config.r" # specify an existing parameter file
parameter_file = NULL
cmgo.obj = CM.run(cmgo.obj, parameter_file)

AntoniusGolly/cmgo documentation built on Sept. 24, 2021, 1:33 a.m.