example_apsim: Access Example APSIM Simulations

Description Usage Arguments Value Examples

Description

Standard APSIM simulations are provided by the default APSIM installation. apsim_example moves those example files into the working directory wd so you can run them or edit them using apsim and edit_apsim, respectively. Generally the example simulations must be moved because the output file is written to the directory containing the .apsim file and the ability to write in the "Program Files" can be limited in some cases.

Usage

1
example_apsim(path, wd = getwd(), files = NULL, ...)

Arguments

path

path to the APSIM installation

wd

working directory containing the .apsim files to be copied; defaults to the current working directory

files

files to extract from the "Examples" folder

...

additional arguments passed to file.copy

Value

logical; if TRUE the corresponding file was successfully copied, FALSE otherwise

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
apsimPath <-"C:/Program Files (x86)/Apsim75-r3008/"
apsimWd <- "~/APSIM"
toRun <- "Canopy.apsim"
example_apsim(path = apsimPath, wd = apsimWd, files = toRun) #TRUE

toRun <- c("Canopy.apsim", "Continuous Wheat.apsim")
example_apsim(path = apsimPath, wd = apsimWd, files = toRun) #TRUE TRUE

apsimExe <-"C:/Program Files (x86)/Apsim75-r3008/Model/Apsim.exe"
results <- apsim(exe = apsimExe, wd = apsimWd, files = toRun)
plot(results[[1]])

## End(Not run)

apsimr documentation built on May 2, 2019, 3:03 a.m.