The function creates sets of input files for one or multiple usms from usms data stored in a JavaSTICS workspace. For multiple usms, sets will be generated into individual folders named with usm names. Observations files will be also copied if they are named [usm_name].obs For one usm, files will be generated either in the workspace directory or in a subdirectory.

gen_usms_xml2txt(
  javastics = NULL,
  workspace = NULL,
  out_dir = NULL,
  usm = c(),
  stics_version = "latest",
  verbose = TRUE,
  dir_per_usm_flag = TRUE,
  java_cmd = "java",
  java_converter = FALSE,
  javastics_path = lifecycle::deprecated(),
  workspace_path = lifecycle::deprecated(),
  target_path = lifecycle::deprecated(),
  usms_list = lifecycle::deprecated()
)

Arguments

javastics

Path of JavaSTICS. Optional (needed if the JavaSTICS converter is used, java_converter set to TRUE in inputs)

workspace

Path of a JavaSTICS workspace (i.e. containing the STICS XML input files). Optional, if not provided the current workspace stored in JavaSTICS preferences will be used.

out_dir

The path of the directory where to create usms directories (Optional), if not provided the JavaSTICS workspace will be used as root

usm

List of usms to generate (Optional). If not provided, all usms contained in workspace/usms.xml file will be generated.

stics_version

the STICS files version to use (optional, default to latest).

verbose

Logical value for displaying information while running

dir_per_usm_flag

logical, TRUE if one want to create one directory per USM, FALSE if USM files are generated in the target_path (only useful for usms_list of size one)

java_cmd

For unix like systems, the java virtual machine command name or executable path. Usefull only if the JavaSTICS command line is used for generating files. "java" is the default system command, but a full path to a java executable (other than the default one) may be given

java_converter

logical TRUE for using JavaStics command (a JavaSTICS path must be set in the function inputs), FALSE otherwise

javastics_path

[Deprecated] javastics_path is no longer supported, use javastics instead.

workspace_path

[Deprecated] workspace_path is no longer supported, use workspace instead.

target_path

[Deprecated] target_path is no longer supported, use out_dir instead.

usms_list

[Deprecated] usms_list is no longer supported, use usm instead.

Value

A list with named elements: usms_path : created directories paths (for storing STICS input files), files : generated files list (in JavaSTICS workspace origin), copy_status : logical value vector, indicating if all files have been generated for each usm obs_copy_status : logical value vector, indicating if observation files have been successfully copied in usms directories

Examples

if (FALSE) {
javastics <- "/path/to/JavaSTICS/folder"
workspace <- "/path/to/workspace"

# For all usms
gen_usms_xml2txt(javastics, workspace)

# For an usms list
usm <- c("usm1", "usm2")
gen_usms_xml2txt(javastics, workspace, usm)

}