View source: R/edit_apsimx_replace_soil_profile.R
edit_apsimx_replace_soil_profile | R Documentation |
Edits an APSIM-X simulation by replacing the soil profile
edit_apsimx_replace_soil_profile(
file = "",
src.dir = ".",
wrt.dir = NULL,
soil.profile = NULL,
edit.tag = "-edited",
overwrite = FALSE,
verbose = TRUE,
root = NULL
)
file |
name of the .apsimx file to be edited |
src.dir |
source directory |
wrt.dir |
writing directory |
soil.profile |
a soil profile object with class ‘soil_profile’ |
edit.tag |
default edit tag ‘-edited’ |
overwrite |
default FALSE |
verbose |
default TRUE and it will print messages to console |
root |
supply the node postion in the case of multiple simulations such as factorials. |
This function is designed to batch replace the whole soil in an APSIM simulation file.
writes a file to disk with the supplied soil profile
There is no such thing as a default soil, carefully build the profile for each simulation.
sp <- apsimx_soil_profile()
extd.dir <- system.file("extdata", package = "apsimx")
## I write to a temp directory but replace as needed
tmp.dir <- tempdir()
edit_apsimx_replace_soil_profile("Maize.apsimx", soil.profile = sp,
src.dir = extd.dir, wrt.dir = tmp.dir)
inspect_apsimx("Maize-edited.apsimx", src.dir = tmp.dir,
node = "Soil")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.