get_param_xml {SticsRFiles}R 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,
  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.

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"))



[Package SticsRFiles version 1.3.0 Index]