View source: R/wget_apsimx_json.R
insert_replacement_node | R Documentation |
Inserts a replacement node in a simple apsimx simulation file
insert_replacement_node(
file,
src.dir,
wrt.dir,
rep.node,
edit.tag = "-edited",
overwrite = FALSE,
verbose = FALSE
)
file |
file ending in .apsimx to be edited (JSON) |
src.dir |
directory containing the .apsimx file to be edited; defaults to the current working directory |
wrt.dir |
should be used if the destination directory is different from the src.dir |
rep.node |
replacement node as obtained by the |
edit.tag |
if the file is edited a different tag from the default ‘-edited’ can be used. |
overwrite |
logical; if |
verbose |
whether to print information about successful edit |
it does not return an R object but it writes an apsimx file to disk
## Not run:
## It is not trivial to produce a reproducible example
## because the model and file versions need to align.
## The steps are:
## 1. Get model:
## wheat <- get_apsimx_json(model = "Wheat", wrt.dir = tmp.dir)
## 2. Create file that matches current model version
## 3. Edit the file by inserting the 'replacements' node
## insert_replacement_node("Wheat.apsimx", rep.node = wheat)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.