knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) is_windows <- .Platform$OS.type == "windows"
The workflow below describes all the steps required for:
Running it from within R
by using the command line (cmd
) and
Importing and Analysing the HYDRUS1D
results within R.
# Enable this universe options(repos = c( kwbr = 'https://kwb-r.r-universe.dev', CRAN = 'https://cloud.r-project.org')) # Install R package install.packages('kwb.hydrus1d')
paths_list <- list( exe_dir = system.file("extdata/model", package = "kwb.hydrus1d"), model_name = "test", model_dir = "<exe_dir>/<model_name>", atmosphere = "<model_dir>/ATMOSPH.IN", a_level = "<model_dir>/A_LEVEL.out", t_level = "<model_dir>/T_LEVEL.out", runinf = "<model_dir>/Run_Inf.out", solute_id = 1L, solute = "<model_dir>/solute<solute_id>.out" ) paths <- kwb.utils::resolve(paths_list)
exe_path <- kwb.hydrus1d::check_hydrus_exe(dir = paths$exe_dir, skip_preinstalled = TRUE) kwb.hydrus1d::run_model(exe_path = exe_path, model_path = paths$model_dir)
a_level <- kwb.hydrus1d::read_alevel(paths$a_level) a_level t_level <- kwb.hydrus1d::read_tlevel(paths$t_level) t_level runinf <- kwb.hydrus1d::read_runinf(paths$runinf) runinf solute <- kwb.hydrus1d::read_solute(paths$solute) solute
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.