## Not run:
# meanYield<-function(x){
# return(mean(x$lai_cowpea))
# }
# n <- 75
# parValues <- data.frame(SoilCN = runif(n, 5, 25),
# DiffusConst = runif(n, 20, 50), CNCov = runif(n, 0, 1))
# apsimExe <-"C:/Program Files (x86)/Apsim75-r3008/Model/Apsim.exe"
# apsimWd <- "~/APSIM"
# apsimVars <- c("SoilOrganicMatter/SoilCN", "SoilWater/DiffusConst", "SoilWater/CNCov")
# apsimFile <- "Canopy.apsim"
# emulRes <- apsim_emul_sa(model = apsim_vector, X = parValues, method = "singleGAM",
# exe = apsimExe, wd = apsimWd, vars = apsimVars, to.run = apsimFile,
# g = meanYield, overwrite = TRUE)
#
# emulRes
# plot(emulRes)
#
# ## End(Not run)
Run the code above in your browser using DataLab