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, rep.node.position = 1, new.core.position = rep.node.position + 1, edit.tag = "-edited", overwrite = FALSE, verbose = TRUE, root )
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 |
rep.node.position |
position where the replacement node will be inserted, default is 1 |
new.core.position |
this by default will place the core simulation below the replacement node position. With this option, this can be modified. |
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 |
root |
supply the node postion in the case of multiple simulations such as factorials. |
it does not return an R object but it writes an apsimx file to disk
## Not run: tmp.dir <- tempdir() wheat <- get_apsimx_json(model = "Wheat", wrt.dir = tmp.dir) extd.dir <- system.file("extdata", package = "apsimx") insert_replacement_node("Wheat.apsimx", src.dir = extd.dir, wrt.dir = tmp.dir, rep.node = wheat) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.