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:
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')) |
Bug tracker:https://github.com/predictiveecology/spades.core/issues
Pkgdown:https://spades-core.predictiveecology.org
discrete-events-simulationssimulation-frameworksimulation-modeling
Last updated 8 days agofrom:f7f60bb8a6 (on development). Checks:OK: 5 NOTE: 2. Indexed: yes.
Target | Result | Date |
---|---|---|
Doc / Vignettes | OK | Nov 25 2024 |
R-4.5-win | NOTE | Nov 25 2024 |
R-4.5-linux | NOTE | Nov 25 2024 |
R-4.4-win | OK | Nov 25 2024 |
R-4.4-mac | OK | Nov 25 2024 |
R-4.3-win | OK | Nov 25 2024 |
R-4.3-mac | OK | Nov 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.Rmd
usingknitr::rmarkdown
on Nov 25 2024.Last update: 2023-07-07
Started: 2017-07-06
02 Building SpaDES modules
Rendered fromii-modules.Rmd
usingknitr::rmarkdown
on Nov 25 2024.Last update: 2024-05-28
Started: 2017-07-06
03 Caching SpaDES simulations
Rendered fromiii-cache.Rmd
usingknitr::rmarkdown
on Nov 25 2024.Last update: 2024-05-30
Started: 2019-01-28
04 Advanced SpaDES use
Rendered fromiv-advanced.Rmd
usingknitr::rmarkdown
on Nov 25 2024.Last update: 2022-12-31
Started: 2019-10-17
05 Automated module testing
Rendered fromv-automated-testing.Rmd
usingknitr::rmarkdown
on Nov 25 2024.Last update: 2020-09-15
Started: 2020-09-15
Readme and manuals
Help Manual
Help page | Topics |
---|---|
Categorized overview of the 'SpaDES.core' package | SpaDES.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' objects | all.equal.simList |
Test whether there should be any plotting from '.plots' module parameter | anyPlotting |
Append attributes | append_attr append_attr,list,list-method |
Simple wrapper around 'data.table::rbindlist' | bindrows |
Check for the existence of a remote module | checkModule checkModule,character,character-method checkModule,character,missing-method |
Check for the existence of a module locally | checkModuleLocal checkModuleLocal,character,ANY,ANY-method checkModuleLocal,character,character,character-method |
Uses "." if getPath not set | checkModulePath |
Check for existence of object(s) referenced by a 'objects' slot of a 'simList' object | checkObject 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 files | checksums |
A citation method for 'SpaDES' modules | citation citation,character-method citation,simList-method |
Filter objects by class | classFilter 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' objects | clearCache,simList-method keepCache,simList-method showCache,simList-method |
Convert standard module code into an R package | convertToPackage |
Copy for 'simList' class objects | Copy,simList-method |
Create a copy of an existing module | copyModule copyModule,character,character,character-method copyModule,character,character,missing-method |
Define an output object of a module | createsOutput createsOutput,ANY,ANY,ANY-method createsOutput,character,character,character-method |
Alternative way to define events in SpaDES.core | defineEvent |
Define a new module. | defineModule defineModule,simList,list-method |
Define a parameter used in a module | defineParameter |
Build edge list for module dependency graph | depsEdgeList depsEdgeList,simList,logical-method depsEdgeList,simList,missing-method |
Build a module dependency graph | depsGraph depsGraph,simList,logical-method depsGraph,simList,missing-method |
SpaDES time units | dday dhour dmin dmonth dmonths dmonths,numeric-method dNA dNA,ANY-method dsecond dweek dweeks dweeks,numeric-method dyear dyears dyears,numeric-method |
Download module data | downloadData 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 repository | downloadModule 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 environment | envir envir,simList-method envir<- envir<-,simList-method simList-accessors-envir |
Simulation event diagram | eventDiagram eventDiagram,simList,missing,character-method eventDiagram,simList,missing,missing-method eventDiagram,simList,numeric,character-method |
Simulation event lists | completed 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 metadata | extractURL extractURL,character,missing-method extractURL,character,simList-method |
Extract filename (without extension) of a file | fileName |
Get copies of sample files for examples and tests | getMapPath getSampleModules |
Find the latest module version from a SpaDES module repository | getModuleVersion getModuleVersion,character,character-method getModuleVersion,character,missing-method |
Get and set global simulation parameters | G G,simList-method G<- G<-,simList-method globals globals,simList-method globals<- globals<-,simList-method |
Generate a 'simList' object | initialize,simList-method initialize,simList_-method |
Metadata accessors | documentation 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 inputs | inputArgs 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 files | loadSimList unzipSimList |
Make 'simList' correctly work with 'memoise' | makeMemoisable.simList unmakeMemoisable.simList_ |
Determine the largest timestep unit in a simulation | maxTimeunit maxTimeunit,simList-method |
Estimate memory used with 'system("ps")' | memoryUse memoryUseThisSession |
Determine the smallest timeunit in a simulation | minTimeunit minTimeunit,list-method minTimeunit,simList-method |
Extract the full file paths for R source code | moduleCodeFiles |
Calculate module coverage of unit tests | moduleCoverage |
Defaults values used in 'defineModule' | moduleDefaults |
Simulation module dependency diagram | moduleDiagram moduleDiagram,simList,ANY,ANY-method moduleDiagram,simList,character,logical-method |
Build a module dependency graph | moduleGraph moduleGraph,simList,logical-method moduleGraph,simList,missing-method |
Parse and extract module metadata | moduleMetadata moduleMetadata,ANY,ANY,ANY-method moduleMetadata,missing,character,character-method moduleMetadata,missing,character,missing-method |
Extract a module's parameters, inputs, or outputs | moduleInputs moduleInputs,character,character-method moduleOutputs moduleOutputs,character,character-method moduleParams moduleParams,character,character-method |
Simulation modules and dependencies | depends depends,simList-method depends<- depends<-,simList-method modules modules,simList-method modules<- modules<-,simList-method simList-accessors-modules |
Parse and extract a module's version | moduleVersion moduleVersion,character,character,missing-method moduleVersion,character,missing,missing-method moduleVersion,character,missing,simList-method |
Create new module from template | newModule 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 modules | newModuleTests newModuleTests,character,character,logical,logical-method |
Show which objects were first created in a 'simInit' or 'spades' call | newObjectsCreated objectsCreated |
Progress bar | newProgressBar setProgressBar |
Create new SpaDES project | newProject newProject,character,character,logical-method newProject,character,character,missing-method |
Create new module code file | newProjectCode newProjectCode,character,character,logical-method |
Text for no event with that name | noEventWarning |
Simulation object dependency diagram | objectDiagram objectDiagram,simList-method |
Identify synonyms in a 'simList' | objectSynonyms |
Extract or replace an object from the simulation environment | findObjects 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 directory | openModules openModules,character,character-method openModules,character,missing-method openModules,missing,character-method openModules,missing,missing-method openModules,simList,missing-method |
Simulation outputs | outputArgs outputArgs,simList-method outputArgs<- outputArgs<-,simList-method outputs outputs,simList-method outputs<- outputs<-,simList-method registerOutputs |
Get module or simulation package dependencies | simList-accessors-packages packages packages,ANY-method |
Test and update a parameter against same parameter in other modules | paramCheckOtherMods |
Get and set simulation parameters | P P<- parameters parameters,simList-method params params,simList-method params<- params<-,simList-method simList-accessors-params |
Specify paths for modules, inputs, outputs, and temporary rasters | cachePath 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' objects | Plot,simList-method |
'Plot' wrapper intended for use in a SpaDES module | Plots |
Event priority | .first .highest .last .lowest .normal priority |
Get and set simulation progress bar details | progressInterval progressInterval,simList-method progressInterval<- progressInterval<-,simList-method progressType progressType,simList-method progressType<- progressType<-,simList-method |
Simple wrapper to load any Raster* object | rasterCreate rasterCreate.default |
Read raster to memory | rasterToMemory rasterToMemory,ANY-method rasterToMemory,character-method rasterToMemory,list-method rasterToMemory,simList-method |
Determine the size of a remotely hosted file | remoteFileSize |
Restart R programmatically | restartR |
Restart an interrupted simulation | restartSpades |
Retrieve environment for saving interrupted simulations | savedSimEnv |
Save objects using '.saveObjects' in 'params' slot of 'simInit' | saveFiles |
Save a whole 'simList' object to disk | saveSim saveSimList |
Schedule a conditional simulation event | scheduleConditionalEvent |
Schedule a simulation event | scheduleEvent |
Show an Object | show,simList-method |
Generate simulation file name | simFile |
Initialize a new simulation | simInit 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' class | simList 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 SpaDES | spadesClasses |
'SpaDES.core' options | spadesOptions |
Assess whether an object has or will be supplied from elsewhere | suppliedElsewhere |
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 list | updateList |
Use GitHub actions for automated module checking | use_gha |
Write simulation event info to file | writeEventInfo |
Write RNG state info to file | writeRNGInfo |
Create a zip archive of a module subdirectory | zipModule 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 files | experiment experiment2 loadPackages POM simInitAndExperiment zipSimList |