inspect_apsimx_json {apsimx}R Documentation

Inspect an .apsimx or .json (JSON) file

Description

inspect an .apsimx or .json (JSON) file. It does not replace the GUI, but it can save time by quickly checking parameters and values.

Usage

inspect_apsimx_json(
  file = "",
  src.dir = ".",
  parm,
  search.depth = 15,
  print.path = FALSE,
  verbose = FALSE
)

Arguments

file

file ending in .apsimx or .json to be inspected (JSON)

src.dir

directory containing the .apsimx or .json file to be inspected; defaults to the current working directory

parm

string or regular expression for partial matching.

search.depth

default is 15. How deep should the algorithm explore the structure of the list.

print.path

whether to print the parameter path (default is FALSE)

verbose

whether to print additional information (mostly used for debugging)

Details

This function is a work in progress. There are many instances for which it will not work.

It will probably only find the first instance that matches.

A future feature will be to search for a jspath instead of simply a regular expression

Value

prints a table with inspected parameters and values (and the path when ‘print.path’ = TRUE).

Examples


extd.dir <- system.file("extdata", package = "apsimx")
## It seems to work for simple search
inspect_apsimx_json("Wheat.apsimx", src.dir = extd.dir, parm = "Version")
inspect_apsimx_json("Wheat.apsimx", src.dir = extd.dir, parm = "Simulations")
inspect_apsimx_json("Wheat.apsimx", src.dir = extd.dir, parm = "Clock")
inspect_apsimx_json("Wheat.apsimx", src.dir = extd.dir, parm = "Weather")
## Does return soil components
inspect_apsimx_json("Wheat.apsimx", src.dir = extd.dir, parm = "DUL")
## Or cultivar
inspect_apsimx_json("Wheat.apsimx", src.dir = extd.dir, parm = "Hartog")



[Package apsimx version 2.6.2 Index]