Description Usage Arguments Value Examples
Change the value of one parameter from an imported MACRO parameter file (PAR). If several rows are found that match the parameter tag, all values are changed.
1 2 | rmacroliteChange1Param(x, pTag, type = NULL, value,
tagNb = NA_integer_)
|
x |
A |
pTag |
Single character string. Text string containing the parameter
value that should be searched and replaced in the PAR file,
with the parameter value replaced by the string |
type |
Single character string. Parameter category (category's header in the PAR file). |
tagNb |
Vector of integer values. If several rows have the same
|
values |
New values for the parameter in |
Returns vector of character strings.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | library( "rmacrolite" )
# Path to an example par-file
par_file_path <- system.file( "par-files",
"chat_winCer_GW-X_900gHa_d182.par",
package = "rmacrolite" )
# Import the example par-file
par_file <- rmacroliteImportParFile(
file = par_file_path )
# Current value of RUNID
as.numeric( rmacroliteGet1Param(
x = par_file,
pTag = "RUNID\t%s",
type = "HEAD" ) )
# Change the RUNID
par_file <- rmacroliteChange1Param(
x = par_file,
pTag = "RUNID\t%s",
type = "HEAD",
value = 2L )
# Check new value
new_run_id <- as.numeric( rmacroliteGet1Param(
x = par_file,
pTag = "RUNID\t%s",
type = "HEAD" ) )
new_run_id
# Internal checks
if( !(new_run_id == 2L) ){
stop( "Test of rmacroliteChange1Param() failed" )
}
# Clean-up
rm( par_file_path, par_file, new_run_id )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.