get_param_xml: Getting parameter values from xml files

View source: R/get_param_xml.R

get_param_xmlR Documentation

Getting parameter values from xml files

Description

Extracting parameter values for a list of xml files and parameters

Usage

get_param_xml(
  file,
  param = NULL,
  select = NULL,
  select_value = NULL,
  value_id = NULL,
  xml_file = lifecycle::deprecated(),
  param_name = lifecycle::deprecated(),
  value = lifecycle::deprecated(),
  ...
)

Arguments

file

Vector of the xml file paths from which parameters values must be extracted

param

Vector of parameter names. Optional, if not provided, the function returns information for all parameters.

select

node name or attribute name to use for selection (optional, default to no selection)

select_value

Vector of values used for select (see examples). Optional, should be provided only if select is provided.

value_id

Vector of ids of the parameters values to be retrieved from the parameter values vector

xml_file

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

param_name

[Deprecated] param_name is no longer supported, use param instead.

value

[Deprecated] value is no longer supported, use select_value instead.

...

Pass further arguments to get_param_value()

Value

A list of parameter values for each xml_file (a list of list)

Examples


# Soil file
file <- file.path(get_examples_path(file_type = "xml"), "sols.xml")

# For all soils
get_param_xml(file)
get_param_xml(file, c("argi", "norg"))

# With soil selection
# scalar parameters per soil
get_param_xml(file, c("argi", "norg"),
  select = "sol", select_value = c("solcanne", "solbanane")
)

# Crop management file
file <- file.path(get_examples_path(file_type = "xml"), "file_tec.xml")

# Getting parameters for irrigation (date and quantity)
get_param_xml(file, c("julapI_or_sum_upvt", "amount"))



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