apsimx_example | R Documentation |
simple function to run some of the built-in APSIM-X examples
apsimx_example(example = "Wheat", silent = FALSE)
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 |
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.
It returns a data frame
This function creates a new column ‘Date’ which is in the R ‘Date’ format which is convenient for graphics.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.