MyNixOS website logo
Description

APSIM Next Generation.

The Agricultural Production Systems sIMulator ('APSIM') is a widely used to simulate the agricultural systems for multiple crops. This package is designed to create, modify and run 'apsimx' files in the 'APSIM' Next Generation <https://www.apsim.info/>.

rapsimng

R-CMD-check

rapsimng package is designed to modify and run the *.apsimx simulations using R in APSIM Next Generation.

Features

  • Find elements in the *.apsimx file

Installation

Install from CRAN.

install.packages('rapsimng')

Install the developing version from Github.

remotes::install_github('byzheng/rapsimng')

Read APSIMX file

The wheat.apsimx in the validation dataset of APSIM NG is used as an example. Function read_apsimx is used to read *.apsimx file through jsonlite::read_json and returns as a list.

# Read Wheat.apsimx file with `read_apsimx` which returns a list of json results.
file <- system.file("extdata/wheat.apsimx", package = "rapsimng")
m <- read_apsimx(file)

Search by of APSIM NG

A node in the apsimx file can be found using the path specification in APSIM NG.

potential <- search_path(m,
    path = '[Structure].BranchingRate.PotentialBranchingRate.Vegetative.PotentialBranchingRate')
potential

Modify a found model

new_model <- potential$node
new_model$XProperty <- 'NewVariable'

Replace the new model

new <- replace_model(m, potential$path, new_model)

Save into a new apsimx file

write_apsimx(new, tempfile(fileext = '.json'))

Run apsimx file

A function run_models is wrapped for APSIM NG Models.exe in the command line and can be called to run apsimx files. See APSIM website for documentation.

Metadata

Version

0.4.4

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows