Generate STICS usms xml file from a template or an input file

gen_usms_xml(
  file,
  param_df = NULL,
  template = NULL,
  stics_version = "latest",
  usms_out_file = lifecycle::deprecated(),
  usms_nb = lifecycle::deprecated(),
  usms_param = lifecycle::deprecated(),
  usms_in_file = lifecycle::deprecated()
)

Arguments

file

Path (including name) of the usms file to generate.

param_df

A table (df, tibble) containing the values of the parameters to use (see details)

template

Path of an USM xml file to be used as a template. Optional, if not provided, the function will use a standard template depending on the STICS version.

stics_version

Name of the STICS version. Optional, used if the file argument is not provided. In this case the function uses a standard template associated to the STICS version.

usms_out_file

[Deprecated] usms_out_file is no longer supported, use file instead.

usms_nb

[Deprecated] usms_nb is no longer supported, use NA instead.

usms_param

[Deprecated] usms_param is no longer supported, use param_df instead.

usms_in_file

[Deprecated] usms_in_file is no longer supported, use template instead.

Value

an invisible xml_document object

Details

Please see get_stics_versions_compat() for the full list of STICS versions that can be used for the argument stics_version.

param_df is a data.frame with the following format:

usm_namedatedebutdatefinnomsol
USM_2017_T1_CI199263USM_T1
USM_2018_T1264570USM_T1
BIN_CANPC_05_SEC_220-0-0_34K_CANPC05T3_Q199263LF1
BIN_AGT_04_IRR_220-0-0_33K_AGT04T2_Q264570LF1
AGA_ARB_13_IRR_220-0-0_37K_ARB13_C199263F1
AGA_ARB_13_SEC_220-0-0_37K_ARB13_C264570LF1
FRA_ARB_11_SEC_220-0-0_38K_E199263LF1
MAG_ARB_09_SEC_220-0-0_38K_E264570LF1
MAG_ARV_12_IRR_220-0-0_36K_ARV12_C199263LF1
MAG_ARV_12_SEC_220-0-0_36K_ARV12_C264570LF1
FRA_ARB_12_SEC_220-0-0_31K_ARB12_C199263LF1
FRA_ARB_13_SEC_220-0-0_37K_ARB13_C264570LF1

The first column gives the usm name, all following columns give the parameter values to put in the usms.xml file for each usm row.

The first column name must contain the keyword Usm or usm or USM as a prefix to be detected (as shown in the table extract above).

If not given (the default, NULL), the function returns the template as is.

Examples

xl_path <- download_usm_xl(file = "inputs_stics_example.xlsx")
#> Warning: inputs_stics_example.xlsx already exists in  /var/folders/n2/pt_35rc53tdgkld9531s2tfh0000gn/T//Rtmp7KS4Yk 
#> Consider to set overwrite = TRUE to overwrite (it | them )
usms_param_df <- read_params_table(file = xl_path, sheet_name = "USMs")
gen_usms_xml(file = file.path(tempdir(), "usms.xml"),
 param_df = usms_param_df)