apsimx_example: Access Example APSIM-X Simulations

View source: R/apsimx.R

apsimx_exampleR Documentation

Access Example APSIM-X Simulations

Description

simple function to run some of the built-in APSIM-X examples

Usage

apsimx_example(example = "Wheat", silent = FALSE)

Arguments

example

run an example from built-in APSIM-X. Options are all of the ones included with the APSIM-X distribution, except ‘Graph’.

silent

whether to print standard output from the APSIM-X execution

Details

This function creates a temporary copy of the example file distributed with APSIM-X to avoid writing a .db file to the directory where the ‘Examples’ are located. It is not a good practice and there is no guarantee that the user has read/write permissions in that directory.

Value

It returns a data frame

Note

This function creates a new column ‘Date’ which is in the R ‘Date’ format which is convenient for graphics.

Examples

## Not run: 
wheat <- apsimx_example("Wheat")
maize <- apsimx_example("Maize")
barley <- apsimx_example("Barley")
## The 'Date' column is created by this function, based on apsim output.
require(ggplot2)
ggplot(data = wheat , aes(x = Date, y = Yield)) + 
  geom_point()

## End(Not run)


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