CM.writeData: Write data

Description Usage Arguments Details Value Author(s) Examples

View source: R/CM.writeData.r

Description

Write output files with channel metrics and the current workspace.

Usage

1
CM.writeData(cmgo.obj)

Arguments

cmgo.obj

the global object of type list containing data and parameters created with CM.ini()

Details

CM.writeData() allows you to write the results to output files and to an R workspace file. The outputs written depend on the settings in the parameter object. If cmgo.obj$par$workspace.write = TRUE (default is FALSE) a workspace file is written containing the global data object. The filename is defined in cmgo.obj$par$workspace.filename. Further, ASCII tables can be written containing the centerline geometry and the calculated metrics. If cmgo.obj$par$output.write = TRUE (default is FALSE) an output file for each data set is written to the output folder specified in cmgo.obj$par$output.dir. The file names are the same as the input filenames with the prefixes cl_* and metrics_*. All parameters regarding the output generation are listed in CM.par().

Value

This file function does not return any value.

Author(s)

Antonius Golly

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# get demo data (find instructions on how to use own data in the documentation of CM.ini())
cmgo.obj = CM.ini("demo2")

# example 1: write workspace
cmgo.obj$par$workspace.write = TRUE
CM.writeData(cmgo.obj)

# example 2: write output files
cmgo.obj$par$output.write = TRUE
cmgo.obj$par$output.write.centerline = TRUE
cmgo.obj$par$output.write.metrics = TRUE
cmgo.obj$par$output.dir   = "custom_output_folder"
cmgo.obj$par$workspace.write = FALSE

CM.writeData(cmgo.obj)

AntoniusGolly/cmgo documentation built on April 16, 2021, 2:52 p.m.