Run apsim from R. It's for Windows only. It uses ‘shell’.
apsim(
file = "",
src.dir = ".",
silent = FALSE,
value = "report",
cleanup = FALSE,
simplify = TRUE
)
This function returns a data frame with APSIM output, but it depends on the argument ‘value’ above.
file name to be run (the extension .apsim is optional)
directory containing the .apsim 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’ runs simulation but does not return a data frame;
option ‘user-defined’ should be the name of a specific output file.
logical. Whether to delete the .out and .sum files generated by APSIM. Default is FALSE.
whether to return a single data frame when multiple simulations are present. If FALSE it will return a list.
Run an APSIM (7.x) ‘Classic’ Simulation
A valid apsim 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 'apsim_example'
# }
Run the code above in your browser using DataLab