View source: R/set_param_txt.R
set_param_txt | R Documentation |
Replace or set an input parameter from a pre-existing STICS input file.
set_param_txt(
workspace,
param,
value,
append = FALSE,
plant_id = NULL,
variety = NULL,
layer = NULL,
stics_version = "latest",
dirpath = lifecycle::deprecated(),
add = lifecycle::deprecated(),
plant = lifecycle::deprecated()
)
set_usm_txt(
file = "new_travail.usm",
param,
value,
append = FALSE,
filepath = lifecycle::deprecated(),
add = lifecycle::deprecated()
)
set_station_txt(
file = "station.txt",
param,
value,
append = FALSE,
filepath = lifecycle::deprecated(),
add = lifecycle::deprecated()
)
set_ini_txt(
file = "ficini.txt",
param,
value,
append = FALSE,
plant_id = 1,
layer = NULL,
stics_version = "latest",
filepath = lifecycle::deprecated(),
add = lifecycle::deprecated()
)
set_general_txt(
file = "tempopar.sti",
param,
value,
append = FALSE,
filepath = lifecycle::deprecated(),
add = lifecycle::deprecated()
)
set_tmp_txt(
file = "tempoparv6.sti",
param,
value,
append = FALSE,
filepath = lifecycle::deprecated(),
add = lifecycle::deprecated()
)
set_plant_txt(
file = "ficplt1.txt",
param,
value,
append = FALSE,
variety = NULL,
filepath = lifecycle::deprecated(),
add = lifecycle::deprecated()
)
set_tec_txt(
file = "fictec1.txt",
param,
value,
append = FALSE,
filepath = lifecycle::deprecated(),
add = lifecycle::deprecated()
)
set_soil_txt(
file = "param.sol",
param,
value,
layer = NULL,
stics_version = "latest",
filepath = lifecycle::deprecated()
)
workspace |
Path of the workspace containing the STICS (txt) input files. |
param |
Vector of parameter names. |
value |
New parameter value |
append |
Boolean. Append input to existing file |
plant_id |
The plant identifier (main crop: 1 ; associated crop: 2). Only used for plant, technical or initialisation parameters. |
variety |
The plant variety to set the parameter value,
either the variety name ( |
layer |
The soil layer if any (only concerns soil-related parameters) |
stics_version |
An optional version name as listed in get_stics_versions_compat() return |
dirpath |
|
add |
|
plant |
|
file |
Path (including name) of the file to modify |
filepath |
The plant
parameter can be either equal to 1
,
2
for the associated plant in the case of intercrop, or
c(1,2)
for both Principal and associated plants.
get_var_info
is a helper function that returns
all possible output variables.
If the variety
is not given and if param
is a varietal parameter, the function will modify the value of
param
for the simulated variety, as given
in the technical file.
None
gen_varmod
is not used by set_param_txt
.
To replace the output variables required from STICS,
please directly call gen_varmod
.
# Getting example data path
path <- get_examples_path(file_type = "txt")
# Change the value of durvieF for the current variety:
set_param_txt(workspace = path, param = "durvieF", value = 245)
# Change the value of durvieF for another variety:
set_param_txt(workspace = path, param = "durvieF",
variety = "Nefer", value = 178)
# If the parameter is found in several files, use the set_*
# functions directly, e.g. cailloux is found in the general file
# ("codecailloux") and the soil file. If we want to change its value
# in the soil file, we use set_soil_txt():
set_soil_txt(file = file.path(path, "param.sol"),
param = "cailloux", layer = 2, value = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.