Learn R Programming

SticsRFiles

The goal of SticsRFiles is to perform manipulations of the STICS model files either on XML files (used by the JavaSTICS GUI) or on text files used by the model fortran executable.

The basic functionalities allows to read parameters names and values through XML queries and replace parameters values in files. A starting guide is available on the Get started page.

Advanced functionalities are dedicated to produce XML parameter files using a mailing process like from XML templates and Excel sheets containing multiple simulations contexts. A JavaSTICS workspace is generated and directly usable from the JavaSTICS interface (GUI or command line), or with an R JavaSTICS interface provided by the SticsOnR package.

If you want to be notified when a new release of this package is made, you can tick the Releases box in the “Watch / Unwatch => Custom” menu at the top right of this page.

Prerequisites and technical tips

Some information about software requirements and operating system constraints are given in the SticsOnR package documentation here.

Installation


Warning: If during the installation process, packages updates are suggested.

  • First, abort the installation.
  • Second, update the installed packages, except the XML package.
  • Finally, install the SticsRFiles package.

Recommended installation: SticsRPacks

The best way to install the packages from SticsRPacks, from which SticsRFiles is part of, is by installing the [SticsRPacks] package. The package can be installed from GitHub using either the devtools package, or the more lightweight the remotes package:

  • With devtools
      devtools::install_github("SticsRPacks/SticsRPacks")
  • With remotes
      remotes::install_github("SticsRPacks/SticsRPacks")

The package will install the packages for you at the latest release version.

Direct installation from the CRAN or GitHub

  • From the CRAN
      install.packages("SticsRFiles")
  • From GitHub
      devtools::install_github("SticsRPacks/SticsRFiles@*release")

      or 
      
      remotes::install_github("SticsRPacks/SticsRFiles@*release")

Normally, all the package dependencies will be installed for CRAN packages.

Examples

Files manipulations

  • A description of how to use the functions for manipulating XML input files is detailed here

  • A description of how to use the functions for manipulating text input files is available here.

Files generation

  • A description of useful functions for generating XML input files from usms parameters data stored in Excel files sheets or CSV files is available here.

  • A description of functions for generating text input files from XML one of usms parameters is available here.

Getting help

If you have any question or suggestion or if you want to report a bug, please do it via the GitHub issues.

Thanks for that, this would greatly help us to improve this package.

Citation

If you have used this package for a study that led to a publication or report, please cite us. You can either use the citation tool from GitHub if you used the last version, or use citation("SticsRFiles") from R otherwise.

Code of conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

The package is under intensive development, so you can fill an issue or request us a feature here at any time.

Copy Link

Version

Install

install.packages('SticsRFiles')

Monthly Downloads

806

Version

1.4.0

License

LGPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Patrice Lecharpentier

Last Published

July 17th, 2024

Functions in SticsRFiles (1.4.0)

gen_sols_xml

Generate STICS sols xml file from a template or an input file
force_param_values

Generates files to force parameters values in STICS simulations
gen_ini_xml

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

Transforming a STICS xml file into a text file
get_examples_path

Getting examples files path attached to a STICS version for a given file type
get_lai_forcing

Getting LAI forcing for each usm
compute_date_from_day

Convert day number into date
gen_varmod

Generating a var.mod type file
download_usm_csv

Downloading a CSV usms data file example into a directory
get_climate_txt

Read STICS input meteorology file
download_data

Download example USMs
gen_tec_xml

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

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

Get the soil names for an usms.xml file
get_sim

Load and format STICS daily output file(s)
get_obs

Read STICS observation files (*.obs)
compute_day_from_date

Convert date into day number
download_usm_xl

Downloading an Excel usms data file example into a directory
gen_usms_xml

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

Upgrading _tec.xml file(s) to a newer version
get_plants_nb

Getting plants number per usm for all usms or selected from a usm name vector
get_param_txt

Read STICS input parameters from text files
get_param_info

Finding parameters information using partial search words
get_usms_list

Getting usms names list for an usms.xml file
upgrade_ini_xml

Upgrading _ini.xml file(s) to a newer version
get_var_info

Find STICS output variable names and description
upgrade_usms_xml

Upgrading a usms.xml file to a newer version
upgrade_param_gen_xml

Upgrading a param_gen.xml file to a newer version
gen_usms_xml2txt

Generating one or several usms directories from a javastics workspace content
get_usms_files

Getting existing xml files path list per usm from an usms.xml file
is_unix

Evaluating if the OS is a unix like type
get_stics_versions_compat

Get the compatible STICS versions
get_report_results

Extracting data from the STICS report file
get_param_xml

Getting parameter values from xml files
get_cultivars_list

Get the cultivar names for an xml plant file (*_plt.xml)
is_windows

Evaluating if the OS is a windows type
upgrade_sta_xml

Upgrading _sta.xml file(s) to a newer version
set_param_txt

Set (replace) STICS input file parameters
read_params_table

Getting parameters data from tables files (Excel sheet, csv)
upgrade_sols_xml

Upgrading a sols.xml file to a newer version
get_cultivars_param

Get the values of cultivar-specific parameters from an xml plant file (*_plt.xml)
upgrade_param_newform_xml

Upgrading a param_newform.xml file to a newer version
upgrade_plt_xml

Upgrading _plt.xml file(s) to a newer version
is_stics_param

Search if a STICS parameter exist
set_param_xml

Setting parameter values into xml files
[.cropr_simulation

[ method for cropr_simulation
is_mac

Evaluating if the OS is a Mac OS type
get_varmod

Get desired STICS outputs
is_stics_var

Search if a STICS variable exist
upgrade_workspace_xml

Upgrading XML files of a JavaSTICS workspace directory to a newer STICS version format
gen_obs

Generating observation data files from a data.frame