View source: R/edit_apsim_replace_soil_profile.R
edit_apsim_replace_soil_profile | R Documentation |
Edits an APSIM Classic simulation by replacing the soil profile
edit_apsim_replace_soil_profile(
file = "",
src.dir = ".",
wrt.dir = NULL,
soil.profile = NULL,
swim = NULL,
soilwat = NULL,
initialwater = NULL,
edit.tag = "-edited",
overwrite = FALSE,
verbose = TRUE,
root
)
file |
name of the .apsim file to be edited |
src.dir |
source directory |
wrt.dir |
writing directory |
soil.profile |
a soil profile object with class ‘soil_profile’ |
swim |
list with SWIM specific parameters |
soilwat |
list with SoilWat specific parameters |
initialwater |
list with InitialWater specific parameters |
edit.tag |
default edit tag ‘-edited’ |
overwrite |
default FALSE |
verbose |
default TRUE. Will print messages indicating what was done. |
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.
writes an APSIM file to disk with the supplied soil profile
There is no such thing as a default soil, carefully build the profile for each simulation. This function replaces values and it can grow an XML node, but it cannot edit a property which is not present in the original file.
sp <- apsimx_soil_profile(nlayers = 20,
crops = c("Barley", "Chickpea", "Lucerne",
"Maize", "Perennial Grass", "Sorghum",
"Wheat", "Millet"))
extd.dir <- system.file("extdata", package = "apsimx")
## Writing to a temp directory
tmp.dir <- tempdir()
edit_apsim_replace_soil_profile("Millet.apsim", soil.profile = sp,
edit.tag = "-newsoil",
src.dir = extd.dir,
wrt.dir = tmp.dir)
inspect_apsim("Millet-newsoil.apsim", src.dir = tmp.dir,
node = "Soil", soil.child = "Water")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.