Run apsimx from R. It uses ‘system’ (unix) or ‘shell’ (windows) and it attempts to be platform independent.
apsimx(
file = "",
src.dir = ".",
silent = FALSE,
value = "report",
cleanup = FALSE,
simplify = TRUE,
xargs
)
a data frame with the ‘Report’ from the APSIM-X simulation. The return value depends on the argument ‘value’ above.
file name to be run (the extension .apsimx is optional)
directory containing the .apsimx file to be run (defaults to the current directory)
whether to print messages from apsim simulation
how much output to return:
option ‘report’ returns only the ‘main’ report component;
option ‘all’ returns all components of the simulation;
option ‘none’ does not create a data.frame but it generates the databases;
option ‘user-defined’ should be the name of a specific table
logical. Whether to delete the .db file generated by APSIM-X. Default is FALSE
whether to return a single data frame when multiple reports are present. If FALSE it will return a list.
extra arguments to be passed to the APSIM-X run. Use function xargs_apsimx.
Run an APSIM-X Simulation
A valid apsimx file can be run from within R. The main goal is to make running APSIM-X simple, especially for large scale simulations or parameter optimization
# \donttest{
## See function 'apsimx_example' and vignette 'apsimx'
# }
Run the code above in your browser using DataLab