gen_tec_xml: Generate STICS tec xml file(s) from a template or an input...

View source: R/gen_tec_xml.R

gen_tec_xmlR Documentation

Generate STICS tec xml file(s) from a template or an input file

Description

Generate STICS tec xml file(s) from a template or an input file

Usage

gen_tec_xml(
  param_df = NULL,
  file = NULL,
  out_dir,
  stics_version = "latest",
  na_values = NA,
  param_table = lifecycle::deprecated(),
  tec_in_file = lifecycle::deprecated(),
  out_path = lifecycle::deprecated()
)

Arguments

param_df

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

file

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

out_dir

Path of the directory where to generate the file(s).

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.

na_values

value to use as missing value in param_table (optional, default : NA)

param_table

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

tec_in_file

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

out_path

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

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:

Tec_name julres_1 coderes_1
USM_2017_T1_CI_tec.xml NA 1
BIN_CANPC_05_SEC_220-0-0_34K_CANPC05T3_Q_tec.xml 110 1
BIN_AGT_04_IRR_220-0-0_33K_AGT04T2_Q_tec.xml 73 1
AGA_ARB_13_IRR_220-0-0_37K_ARB13_C_tec.xml 82 1
AGA_ARB_13_SEC_220-0-0_37K_ARB13_C_tec.xml 82 1
FRA_ARB_11_SEC_220-0-0_38K_E_tec.xml 70 1
MAG_ARB_09_SEC_220-0-0_38K_E_tec.xml 81 1
MAG_ARV_12_IRR_220-0-0_36K_ARV12_C_tec.xml 100 1
MAG_ARV_12_SEC_220-0-0_36K_ARV12_C_tec.xml 100 1
FRA_ARB_12_SEC_220-0-0_31K_ARB12_C_tec.xml 92 1
FRA_ARB_13_SEC_220-0-0_37K_ARB13_C_tec.xml 82 1

The first column gives the tec file name (to be generated), all following columns give the parameter value to put in the file, and each line denotes a separate tec file (for e.g. several USMs).

The first column name must contain the keyword tec or Tec or TEC 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.

Value

None

Examples

xl_path <- download_usm_xl(file = "inputs_stics_example.xlsx")
tec_param_df <- read_params_table(file = xl_path, sheet_name = "Tec")
gen_tec_xml(out_dir = tempdir(), param_df = tec_param_df[1:2, ])


SticsRFiles documentation built on Sept. 12, 2024, 7:41 a.m.