convert_xml2txt: Transforming a STICS xml file into a text file

View source: R/convert_xml2txt.R

convert_xml2txtR Documentation

Transforming a STICS xml file into a text file

Description

The input file according to his type (ini,plant,tec,station,soil,par) is converted to a text file readable by the STICS model (ficini.txt, ficplt1.txt,...)

Usage

convert_xml2txt(
  file,
  plant_id = 1,
  soil_name = NULL,
  out_dir = NULL,
  save_as = NULL,
  stics_version = "latest"
)

Arguments

file

Path (including name) of the xml file to convert

plant_id

The plant identifier (main crop: 1 ; associated crop: 2)

soil_name

Soil name (optional, required for soil file)

out_dir

Path of the directory where to generate the file. Optional, set to the path of the input xml file by default

save_as

Name of the output file (optional, default: fixed name for STICS)

stics_version

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

Value

None

Examples

xml_path <- file.path(get_examples_path("xml"), "file_plt.xml")
convert_xml2txt(file = xml_path)
xml_path <- file.path(get_examples_path("xml"), "sols.xml")
convert_xml2txt(file = xml_path, soil_name = "soil_rice")


SticsRPacks/SticsRFiles documentation built on July 4, 2025, 4:19 p.m.