edit_apsimx_replace_soil_profile: Edit APSIM-X file with a replaced soil profile

View source: R/edit_apsimx_replace_soil_profile.R

edit_apsimx_replace_soil_profileR Documentation

Edit APSIM-X file with a replaced soil profile

Description

Edits an APSIM-X simulation by replacing the soil profile

Usage

edit_apsimx_replace_soil_profile(
  file = "",
  src.dir = ".",
  wrt.dir = NULL,
  soil.profile = NULL,
  edit.tag = "-edited",
  overwrite = FALSE,
  verbose = TRUE,
  root = NULL
)

Arguments

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.

Details

This function is designed to batch replace the whole soil in an APSIM simulation file.

Value

writes a file to disk with the supplied soil profile

Note

There is no such thing as a default soil, carefully build the profile for each simulation.

Examples


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")
 


apsimx documentation built on Sept. 11, 2024, 5:42 p.m.