Package: SpaDES.core 2.1.5.9002

Eliot J B McIntire

SpaDES.core: Core Utilities for Developing and Running Spatially Explicit Discrete Event Models

Provides the core framework for a discrete event system to implement a complete data-to-decisions, reproducible workflow. The core components facilitate the development of modular pieces, and enable the user to include additional functionality by running user-built modules. Includes conditional scheduling, restart after interruption, packaging of reusable modules, tools for developing arbitrary automated workflows, automated interweaving of modules of different temporal resolution, and tools for visualizing and understanding the within-project dependencies. The suggested package 'NLMR' can be installed from the repository (<https://PredictiveEcology.r-universe.dev>).

Authors:Alex M Chubaty [aut], Eliot J B McIntire [aut, cre], Yong Luo [ctb], Steve Cumming [ctb], Ceres Barros [ctb], His Majesty the King in Right of Canada, as represented by the Minister of Natural Resources Canada [cph]

SpaDES.core_2.1.5.9002.tar.gz
SpaDES.core_2.1.5.9002.zip(r-4.5)SpaDES.core_2.1.5.9002.zip(r-4.4)SpaDES.core_2.1.5.9002.zip(r-4.3)
SpaDES.core_2.1.5.9002.tgz(r-4.4-any)SpaDES.core_2.1.5.9002.tgz(r-4.3-any)
SpaDES.core_2.1.5.9002.tar.gz(r-4.5-noble)SpaDES.core_2.1.5.9002.tar.gz(r-4.4-noble)
SpaDES.core_2.1.5.9002.tgz(r-4.4-emscripten)SpaDES.core_2.1.5.9002.tgz(r-4.3-emscripten)
SpaDES.core.pdf |SpaDES.core.html
SpaDES.core/json (API)
NEWS

# Install 'SpaDES.core' in R:
install.packages('SpaDES.core', repos = c('https://predictiveecology.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/predictiveecology/spades.core/issues

Pkgdown:https://spades-core.predictiveecology.org

On CRAN:

discrete-events-simulationssimulation-frameworksimulation-modeling

10.47 score 9 stars 5 packages 262 scripts 975 downloads 4 mentions 218 exports 31 dependencies

Last updated 8 days agofrom:f7f60bb8a6 (on development). Checks:OK: 5 NOTE: 2. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 25 2024
R-4.5-winNOTENov 25 2024
R-4.5-linuxNOTENov 25 2024
R-4.4-winOKNov 25 2024
R-4.4-macOKNov 25 2024
R-4.3-winOKNov 25 2024
R-4.3-macOKNov 25 2024

Exports:.addChangedAttr.addTagsToOutput.cacheMessage.callingModuleName.checkCacheRepo.depsLoadOrder.depsPruneEdges.fileExtensions.first.highest.last.lowest.normal.parseElems.parseModulePartial.paths.preDigestByClass.prepareOutput.quickCheck.robustDigest.saveFileExtensions.tagsByClassanyPlottingappend_attrbindrowscachePathcachePath<-checkModulecheckModuleLocalcheckObjectcheckParamscheckpointFilecheckpointFile<-checkpointIntervalcheckpointInterval<-checkpointLoadcheckTimeunitcitationclassFilterclearCachecompletedcompleted<-conditionalEventsconvertTimeunitconvertToPackageCopycopyModulecreatesOutputcurrentcurrent<-currentModuledataPathddaydefineEventdefineModuledefineParameterdependsdepends<-depsEdgeListdepsGraphdhourdmindmonthdmonthsdNAdocumentationdoEventdoEvent.checkpointdownloadDatadownloadModuledseconddweekdweeksdyeardyearselapsedTimeendend<-envirenvir<-eventDiagrameventsevents<-expectsInputexperimentexperiment2extractURLfigurePathfindObjectsGG<-getMapPathgetModuleVersiongetPathsgetSampleModulesglobalsglobals<-initializeinputArgsinputArgs<-inputObjectsinputPathinputPath<-inputsinputs<-inSecondskeepCacheloadFilesloadSimListlogPathmaxTimeunitmemoryUsememoryUseThisSessionminTimeunitmoduleCodeFilesmoduleDefaultsmoduleDiagrammoduleGraphmoduleInputsmoduleMetadatamoduleObjectsmoduleOutputsmoduleParamsmodulePathmodulePath<-modulesmodules<-moduleVersionnewModulenewModuleCodenewModuleDocumentationnewModuleTestsnewObjectsCreatednewProgressBarnewProjectnewProjectCodenoEventWarningobjectDiagramobjectSynonymsobjsobjs<-openModulesoutputArgsoutputArgs<-outputObjectNamesoutputObjectsoutputPathoutputPath<-outputsoutputs<-PP<-packagespaddedFloatToCharparamCheckOtherModsparametersparamsparams<-pathsPathspaths<-PlotPlotsPOMprogressIntervalprogressInterval<-progressTypeprogressType<-rasterCreaterasterPathrasterPath<-rasterToMemoryregisterOutputsremoteFileSizereqdPkgsrestartRrestartSpadesrndstrsavedSimEnvsaveFilessaveSimListscheduleConditionalEventscheduleEventscratchPathscratchPath<-sessInfosetPathsshowshowCachesimFilesimInitsimInit2simInitAndExperimentsimInitAndSpadessimInitAndSpades2simInitDefaultsspadesspades2spadesOptionsspadesTimesstartstart<-suppliedElsewhereterraPathterraPath<-time<-timestimes<-timeunittimeunit<-timeunitsunzipSimListupdateListuse_ghawriteEventInfowriteRNGInfozipModulezipSimList

Dependencies:BHclicpp11crayondata.tabledigestfilelockfpComparefsglueigraphlatticelifecyclelobstrmagrittrMatrixpkgconfigprettyunitsqsquickPlotRApiSerializeRcppRcppParallelreproducibleRequirerlangstringfishsysterravctrswhisker

01 Introduction to SpaDES

Rendered fromi-introduction.Rmdusingknitr::rmarkdownon Nov 25 2024.

Last update: 2023-07-07
Started: 2017-07-06

02 Building SpaDES modules

Rendered fromii-modules.Rmdusingknitr::rmarkdownon Nov 25 2024.

Last update: 2024-05-28
Started: 2017-07-06

03 Caching SpaDES simulations

Rendered fromiii-cache.Rmdusingknitr::rmarkdownon Nov 25 2024.

Last update: 2024-05-30
Started: 2019-01-28

04 Advanced SpaDES use

Rendered fromiv-advanced.Rmdusingknitr::rmarkdownon Nov 25 2024.

Last update: 2022-12-31
Started: 2019-10-17

05 Automated module testing

Rendered fromv-automated-testing.Rmdusingknitr::rmarkdownon Nov 25 2024.

Last update: 2020-09-15
Started: 2020-09-15

Readme and manuals

Help Manual

Help pageTopics
Categorized overview of the 'SpaDES.core' packageSpaDES.core-package SpaDES.core
'.addChangedAttr' for 'simList' objects.addChangedAttr,simList-method
'.addTagsToOutput' for 'simList' objects.addTagsToOutput,simList-method
'.cacheMessage' for 'simList' objects.cacheMessage,simList-method
'.checkCacheRepo' for 'simList' objects.checkCacheRepo,list-method
File extensions map.fileExtensions .saveFileExtensions loadFiles loadFiles,missing,ANY-method loadFiles,missing,missing-method loadFiles,simList,missing-method
Find 'simList' in a nested list.findSimList
Guess package of a function.guessPkgFun
'.parseElems' for 'simList' class objects.parseElems,simList-method
Pre-digesting method for 'simList'.preDigestByClass,simList-method
'.prepareOutput' for 'simList' objects.prepareOutput,simList-method
The 'SpaDES.core' variable to switch between quick and robust checking.quickCheck
Generate random strings.rndstr rndstr rndstr,missing,missing,logical-method rndstr,missing,missing,missing-method rndstr,missing,numeric,logical-method rndstr,missing,numeric,missing-method rndstr,numeric,missing,logical-method rndstr,numeric,missing,missing-method rndstr,numeric,numeric,logical-method rndstr,numeric,numeric,missing-method
'.robustDigest' for 'simList' objects.robustDigest,simList-method Cache
'.tagsByClass' for 'simList' objects.tagsByClass,simList-method
Methods for '.wrap' and '.unwrap'.unwrap..moduleDeps .unwrap..simDeps .unwrap.simList .wrap..moduleDeps .wrap..simDeps .wrap.simList
Extract an intact 'simList' but with subset of objects[,simList,character,ANY-method
All equal method for 'simList' objectsall.equal.simList
Test whether there should be any plotting from '.plots' module parameteranyPlotting
Append attributesappend_attr append_attr,list,list-method
Simple wrapper around 'data.table::rbindlist'bindrows
Check for the existence of a remote modulecheckModule checkModule,character,character-method checkModule,character,missing-method
Check for the existence of a module locallycheckModuleLocal checkModuleLocal,character,ANY,ANY-method checkModuleLocal,character,character,character-method
Uses "." if getPath not setcheckModulePath
Check for existence of object(s) referenced by a 'objects' slot of a 'simList' objectcheckObject checkObject,missing,ANY,ANY-method checkObject,simList,ANY,ANY-method checkObject,simList,character,missing-method
Check use and existence of parameters passed to simulation.checkParams checkParams,simList,list-method
Simulation checkpoints.checkpointSave checkpointFile checkpointFile,simList-method checkpointFile<- checkpointFile<-,simList-method checkpointInterval checkpointInterval,simList-method checkpointInterval<- checkpointInterval<-,simList-method checkpointLoad doEvent.checkpoint
Calculate checksum for a module's data fileschecksums
A citation method for 'SpaDES' modulescitation citation,character-method citation,simList-method
Filter objects by classclassFilter classFilter,character,character,character,environment-method classFilter,character,character,character,missing-method classFilter,character,character,missing,environment-method classFilter,character,character,missing,missing-method
'clearCache' for 'simList' objectsclearCache,simList-method keepCache,simList-method showCache,simList-method
Convert standard module code into an R packageconvertToPackage
Copy for 'simList' class objectsCopy,simList-method
Create a copy of an existing modulecopyModule copyModule,character,character,character-method copyModule,character,character,missing-method
Define an output object of a modulecreatesOutput createsOutput,ANY,ANY,ANY-method createsOutput,character,character,character-method
Alternative way to define events in SpaDES.coredefineEvent
Define a new module.defineModule defineModule,simList,list-method
Define a parameter used in a moduledefineParameter
Build edge list for module dependency graphdepsEdgeList depsEdgeList,simList,logical-method depsEdgeList,simList,missing-method
Build a module dependency graphdepsGraph depsGraph,simList,logical-method depsGraph,simList,missing-method
SpaDES time unitsdday dhour dmin dmonth dmonths dmonths,numeric-method dNA dNA,ANY-method dsecond dweek dweeks dweeks,numeric-method dyear dyears dyears,numeric-method
Download module datadownloadData downloadData,character,character,logical-method downloadData,character,character,missing-method downloadData,character,missing,logical-method downloadData,character,missing,missing-method
Download a module from a SpaDES module GitHub repositorydownloadModule downloadModule,character,ANY,ANY,ANY,ANY,ANY,ANY,ANY-method downloadModule,character,character,character,character,logical,logical,ANY,logical-method downloadModule,character,missing,missing,missing,missing,missing,ANY,ANY-method
Simulation environmentenvir envir,simList-method envir<- envir<-,simList-method simList-accessors-envir
Simulation event diagrameventDiagram eventDiagram,simList,missing,character-method eventDiagram,simList,missing,missing-method eventDiagram,simList,numeric,character-method
Simulation event listscompleted completed,simList,character-method completed,simList,missing-method completed<- completed<-,simList-method conditionalEvents conditionalEvents,simList,character-method conditionalEvents,simList,missing-method current current,simList,character-method current,simList,missing-method current<- current<-,simList-method events events,simList,character-method events,simList,missing-method events<- events<-,simList-method simList-accessors-events
Define an input object that the module expects.expectsInput expectsInput,ANY,ANY,ANY,ANY-method expectsInput,character,character,character,character-method expectsInput,character,character,character,missing-method
Extract a url from module metadataextractURL extractURL,character,missing-method extractURL,character,simList-method
Extract filename (without extension) of a filefileName
Get copies of sample files for examples and testsgetMapPath getSampleModules
Find the latest module version from a SpaDES module repositorygetModuleVersion getModuleVersion,character,character-method getModuleVersion,character,missing-method
Get and set global simulation parametersG G,simList-method G<- G<-,simList-method globals globals,simList-method globals<- globals<-,simList-method
Generate a 'simList' objectinitialize,simList-method initialize,simList_-method
Metadata accessorsdocumentation documentation,simList-method inputObjects inputObjects,missing-method inputObjects,simList-method outputObjectNames outputObjectNames,simList-method outputObjects outputObjects,missing-method outputObjects,simList-method reqdPkgs reqdPkgs,missing-method reqdPkgs,simList-method sessInfo sessInfo,simList-method simList-accessors-metadata
Simulation inputsinputArgs inputArgs,simList-method inputArgs<- inputArgs<-,simList-method inputs inputs,simList-method inputs<- inputs<-,simList-method simList-accessors-inout
Convert time units.spadesTimes checkTimeunit checkTimeunit,character,environment-method checkTimeunit,character,missing-method convertTimeunit inSeconds spadesTimes
Load a saved 'simList' and ancillary filesloadSimList unzipSimList
Make 'simList' correctly work with 'memoise'makeMemoisable.simList unmakeMemoisable.simList_
Determine the largest timestep unit in a simulationmaxTimeunit maxTimeunit,simList-method
Estimate memory used with 'system("ps")'memoryUse memoryUseThisSession
Determine the smallest timeunit in a simulationminTimeunit minTimeunit,list-method minTimeunit,simList-method
Extract the full file paths for R source codemoduleCodeFiles
Calculate module coverage of unit testsmoduleCoverage
Defaults values used in 'defineModule'moduleDefaults
Simulation module dependency diagrammoduleDiagram moduleDiagram,simList,ANY,ANY-method moduleDiagram,simList,character,logical-method
Build a module dependency graphmoduleGraph moduleGraph,simList,logical-method moduleGraph,simList,missing-method
Parse and extract module metadatamoduleMetadata moduleMetadata,ANY,ANY,ANY-method moduleMetadata,missing,character,character-method moduleMetadata,missing,character,missing-method
Extract a module's parameters, inputs, or outputsmoduleInputs moduleInputs,character,character-method moduleOutputs moduleOutputs,character,character-method moduleParams moduleParams,character,character-method
Simulation modules and dependenciesdepends depends,simList-method depends<- depends<-,simList-method modules modules,simList-method modules<- modules<-,simList-method simList-accessors-modules
Parse and extract a module's versionmoduleVersion moduleVersion,character,character,missing-method moduleVersion,character,missing,missing-method moduleVersion,character,missing,simList-method
Create new module from templatenewModule newModule,character,character-method newModule,character,missing-method newModuleCode newModuleCode,character,character-method newModuleDocumentation newModuleDocumentation,character,character-method newModuleDocumentation,character,missing-method
Create template testing structures for new modulesnewModuleTests newModuleTests,character,character,logical,logical-method
Show which objects were first created in a 'simInit' or 'spades' callnewObjectsCreated objectsCreated
Progress barnewProgressBar setProgressBar
Create new SpaDES projectnewProject newProject,character,character,logical-method newProject,character,character,missing-method
Create new module code filenewProjectCode newProjectCode,character,character,logical-method
Text for no event with that namenoEventWarning
Simulation object dependency diagramobjectDiagram objectDiagram,simList-method
Identify synonyms in a 'simList'objectSynonyms
Extract or replace an object from the simulation environmentfindObjects moduleObjects objs objs,simList-method objs<- objs<-,simList-method simList-accessors-objects
Object size for 'simList'objSize.simList
Open all modules nested within a base directoryopenModules openModules,character,character-method openModules,character,missing-method openModules,missing,character-method openModules,missing,missing-method openModules,simList,missing-method
Simulation outputsoutputArgs outputArgs,simList-method outputArgs<- outputArgs<-,simList-method outputs outputs,simList-method outputs<- outputs<-,simList-method registerOutputs
Get module or simulation package dependenciessimList-accessors-packages packages packages,ANY-method
Test and update a parameter against same parameter in other modulesparamCheckOtherMods
Get and set simulation parametersP P<- parameters parameters,simList-method params params,simList-method params<- params<-,simList-method simList-accessors-params
Specify paths for modules, inputs, outputs, and temporary rasterscachePath cachePath,simList-method cachePath<- cachePath<-,simList-method dataPath dataPath,simList-method figurePath figurePath,simList-method inputPath inputPath,simList-method inputPath<- inputPath<-,simList-method logPath logPath,simList-method modulePath modulePath,simList-method modulePath<- modulePath<-,simList-method outputPath outputPath,simList-method outputPath<- outputPath<-,simList-method paths paths,simList-method paths<- paths<-,simList-method rasterPath rasterPath,simList-method rasterPath<- rasterPath<-,simList-method scratchPath scratchPath,simList-method scratchPath<- scratchPath<-,simList-method simList-accessors-paths terraPath terraPath,simList-method terraPath<- terraPath<-,simList-method
Plot method for 'simList' objectsPlot,simList-method
'Plot' wrapper intended for use in a SpaDES modulePlots
Event priority.first .highest .last .lowest .normal priority
Get and set simulation progress bar detailsprogressInterval progressInterval,simList-method progressInterval<- progressInterval<-,simList-method progressType progressType,simList-method progressType<- progressType<-,simList-method
Simple wrapper to load any Raster* objectrasterCreate rasterCreate.default
Read raster to memoryrasterToMemory rasterToMemory,ANY-method rasterToMemory,character-method rasterToMemory,list-method rasterToMemory,simList-method
Determine the size of a remotely hosted fileremoteFileSize
Restart R programmaticallyrestartR
Restart an interrupted simulationrestartSpades
Retrieve environment for saving interrupted simulationssavedSimEnv
Save objects using '.saveObjects' in 'params' slot of 'simInit'saveFiles
Save a whole 'simList' object to disksaveSim saveSimList
Schedule a conditional simulation eventscheduleConditionalEvent
Schedule a simulation eventscheduleEvent
Show an Objectshow,simList-method
Generate simulation file namesimFile
Initialize a new simulationsimInit simInit,ANY,ANY,ANY,ANY,ANY,ANY,ANY,ANY-method simInit,ANY,ANY,ANY,character,ANY,ANY,ANY,ANY-method simInit,ANY,ANY,character,ANY,ANY,ANY,ANY,ANY-method simInit,list,list,list,list,list,data.frame,data.frame,character-method simInit2 simInitDefaults
'simInitAndSpades2' is a convenience wrapper for 'do.call(simInitAndSpades, listOfArgs)', i.e., a user can pass a list of all the arguments.simInitAndSpades simInitAndSpades2
The 'simList' classsimList simList-class simList_ simList_-class
'spades2' is a convenience wrapper for 'do.call(spades, listOfArgs)', i.e., a user can pass a list of all the arguments.spades spades,ANY,ANY,ANY,logical-method spades,simList,ANY,ANY,missing-method spades2
Classes defined in SpaDESspadesClasses
'SpaDES.core' optionsspadesOptions
Assess whether an object has or will be supplied from elsewheresuppliedElsewhere
Time usage in 'SpaDES'elapsedTime elapsedTime.simList end end.simList end<- end<-,simList-method simList-accessors-times start start.simList start<- start<-,simList-method time.simList time<- time<-,simList-method times times,simList-method times<- times<-,simList-method timeunit timeunit,simList-method timeunit<- timeunit<-,simList-method timeunits timeunits,simList-method
Update elements of a named list with elements of a second named listupdateList
Use GitHub actions for automated module checkinguse_gha
Write simulation event info to filewriteEventInfo
Write RNG state info to filewriteRNGInfo
Create a zip archive of a module subdirectoryzipModule zipModule,character,character,character-method zipModule,character,character,missing-method zipModule,character,missing,character-method zipModule,character,missing,missing-method
Zip a 'simList' and various filesexperiment experiment2 loadPackages POM simInitAndExperiment zipSimList