mySim <- simInit()
suppliedElsewhere("test", mySim) # FALSE
# supplied in the simList
mySim$test <- 1
suppliedElsewhere("test", mySim) # TRUE
test <- 1
# supplied from user at simInit time -- note, this object would eventually get into the simList
# but the user supplied values come *after* the module's .inputObjects, so
# a basic is.null(sim$test) would return TRUE even though the user supplied test
mySim <- simInit(objects = list("test" = test))
suppliedElsewhere("test", mySim) # TRUE
# \donttest{
# Example with prepInputs
# Put chunks like this in your .inputObjects
if (!suppliedElsewhere("test", mySim))
sim$test <- Cache(prepInputs, "raster.tif", "downloadedArchive.zip",
destinationPath = dataPath(sim), studyArea = sim$studyArea,
rasterToMatch = sim$otherRasterTemplate, overwrite = TRUE)
# }
Run the code above in your browser using DataLab