Learn R Programming

SpaDES.core

Core functionality for Spatial Discrete Event System (SpaDES).

This package provides the core framework for a discrete event system to implement a complete data-to-decisions, reproducible workflow (e.g., McIntire et al. (2022) https://doi.org/10.1111/ele.13994, Barros et al. (2022) https://doi.org/10.1111/2041-210X.14034). 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.

Website: https://SpaDES-core.PredictiveEcology.org

Wiki: https://github.com/PredictiveEcology/SpaDES/wiki

Installation

Current stable release

Install from CRAN:

install.packages("SpaDES.core")

Install from GitHub:

#install.packages("devtools")
library("devtools")
install_github("PredictiveEcology/SpaDES.core", dependencies = TRUE) # master

Development version (unstable)

Install from GitHub:

#install.packages("devtools")
library("devtools")
install_github("PredictiveEcology/SpaDES.core", ref = "development", dependencies = TRUE)

Contributions

Please see CONTRIBUTING.md for information on how to contribute to this project.

Copy Link

Version

Install

install.packages('SpaDES.core')

Monthly Downloads

372

Version

3.2.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Eliot J B

Last Published

August 29th, 2026

Functions in SpaDES.core (3.2.1)

.addTagsToOutput,simList-method

.addTagsToOutput for simList objects
anyPlotting

Test whether there should be any plotting from .plots module parameter
.addDepends

Add simulation dependencies
SpaDES.core-package

Categorized overview of the SpaDES.core package
Plots

Plot wrapper intended for use in a SpaDES module
Copy,simList-method

Copy for simList class objects
all.equal.simList

All equal method for simList objects
Plot,simList-method

Plot method for simList objects
.addChangedAttr,simList-method

.addChangedAttr for simList objects
FilterRecursive

Recursively Filter a list
checkModule

Check for the existence of a remote module
append_attr

Append attributes
checkModuleLocal

Check for the existence of a module locally
.checkCacheRepo,list-method

.checkCacheRepo for simList objects
checkObject

Check for existence of object(s) referenced by a objects slot of a simList object
.cacheMessage,simList-method

.cacheMessage for simList objects
checkModulePath

Check module path
checkParams

Check use and existence of parameters passed to simulation.
bindrows

Simple wrapper around data.table::rbindlist
checkModuleMetadata

Statically check a SpaDES module file for malformed metadata
clearCacheEventsOnly

Convenience wrapper around clearCache for SpaDES events
clearCache,simList-method

clearCache for simList objects
checksums

Calculate checksum for a module's data files
checkpointFile

Simulation checkpoints
.coreModules

Named list of core SpaDES modules
copyModule

Create a copy of an existing module
citation

A citation method for SpaDES modules
convertToPackage

Convert standard module code into an R package
codeCheckModule

Statically check a SpaDES module's source code (v2)
classFilter

Filter objects by class
.wrap.simList

Methods for .wrap and .unwrap
depsEdgeList

Build edge list for module dependency graph
createsOutput

Define an output object of a module
defineEvent

Alternative way to define events in SpaDES.core
depsGraph

Build a module dependency graph
.depsLoadOrder

Determine module load order
zipSimList

Zip a simList and various files
defineModule

Define a new module.
defineParameter

Define a parameter used in a module
.depsPruneEdges

Prune edges to remove cycles in module dependencies
.fnsReachableFrom

Transitive closure of module-local functions reachable from a starting function
.guessPkgFun

Guess package of a function
doCallSafe

Memory safe alternative to do.call
.knownDotParams

Reserved module parameter names
.charLiteralsIn

Collect character-string literals appearing in a parsed expression
.findObjects

Find objects if passed as character strings
.finishSimInit

Finish initialization of a simList after the .inputObjects phase
.cleanPkgs

strip GitHub repo info from vector of packages
.fillDotParams

Fill in unspecified dotParams for a module
doEvent

Process a simulation event
downloadModule

Download a module from a SpaDES module GitHub repository
.stepEvent

Process one event with recovery wrapping
downloadData

Download module data
.restartResolveSim

Resolve the sim argument for the restart functions
.restartModuleToReparse

Identify the module whose source should be re-parsed on restart
.restartRefreshBindings

Re-establish the mod/P active bindings for re-parsed modules (shared)
.restartRestoreEventObjs

Restore one recovered event's object state on restart (shared rewind core)
.runInputObjectsPhase

Run (or resume) a simList's .inputObjects phase
.reparseModules

Re-parse module source into a simList
emptyEventList

Blank (template) event list
.fileEdit

Open a file for editing
extractURL

Extract a url from module metadata
expectsInput

Define an input object that the module expects.
eventDiagram

Simulation event diagram
.findElementsInEnv

Find all references to sim$
.fileTableIn

Create empty fileTable for inputs and outputs
.fillOutputRows

An internal function for coercing a data.frame to outputs()
.emptyMetadata

Default (empty) metadata
.fillInputRows

An internal function for coercing a data.frame to inputs()
fileName

Extract filename (without extension) of a file
ganttStatus

ganttStatus
globals

Get and set global simulation parameters
getMapPath

Get copies of sample files for examples and tests
findProjectPath

Find the project root directory
getModuleVersion

Find the latest module version from a SpaDES module repository
.findSimList

Find simList in a nested list
.identifyChildModules

Identify child modules from a recursive list
.getModuleInputObjects

Extract the user-defined .inputObjects function from a module
.findModuleName

Identify module names up to a given recursive level
.getOption

A slightly modified version of getOption()
.isNamespaced

Check is module uses module namespacing
maxTimeunit

Determine the largest timestep unit in a simulation
initialize,simList-method

Generate a simList object
memoryUseThisSession

Estimate memory used with system("ps")
.fileExtensions

File extensions map
makeMemoisable.simList

Make simList correctly work with memoise
loadSimList

Load a saved simList and ancillary files
inputObjectNames

Per-module input object names
._inputObjectsDF

Create an empty data.frame object for use with inputObjects or outputObjects
.keepAttrs

Attach missing attributes from x to y
minTimeunit

Determine the smallest timeunit in a simulation
moduleDiagram

Simulation module dependency diagram
moduleDefaults

Defaults values used in defineModule
.moduleDeps-class

The .moduleDeps class
moduleParams

Extract a module's parameters, inputs, or outputs
moduleGraph

Build a module dependency graph
moduleCodeFiles

Extract the full file paths for R source code
moduleMetadata

Parse and extract module metadata
moduleCoverage

Calculate module coverage of unit tests
.modifySearchPath

Modify package order in search path
moduleVersion

Parse and extract a module's version
newProjectCode

Create new module code file
objectSynonyms

Identify synonyms in a simList
noEventWarning

Text for no event with that name
newModuleTests

Create template testing structures for new modules
objectDiagram

Simulation object dependency diagram
newModule

Create new module from template
newProject

Create new SpaDES project
.callingModuleName

Namespacing within SpaDES
objSize.simList

Object size for simList
.parseModulePartial

Parse and initialize a module
packages

Get module or simulation package dependencies
.preDigestByClass,simList-method

Pre-digesting method for simList
.parseElems,simList-method

.parseElems for simList class objects
objs

Extract or replace an object from the simulation environment
openModules

Open all modules nested within a base directory
paramCheckOtherMods

Test and update a parameter against same parameter in other modules
params

Get and set simulation parameters
.pkgEnv

The SpaDES.core package environment
.parseMessage

Prepend module name to a message
reexports

Objects exported from other packages
newProgressBar

Progress bar
.prepareOutput,simList-method

.prepareOutput for simList objects
rasterToMemory

Read raster to memory
progressInterval

Get and set simulation progress bar details
restartR

Restart R programmatically
remoteFileSize

Determine the size of a remotely hosted file
.quickCheck

The SpaDES.core variable to switch between quick and robust checking
rasterCreate

Simple wrapper to load any Raster* object
priority

Event priority
.robustDigest,simList-method

.robustDigest for simList objects
saveSimOnExitSimInit

Save the simList on exit from simInit, mirroring saveSimOnExit()
.runCodeChecks

Runs a series of code checks during simInit()
saveFiles

Save objects using .saveObjects in params slot of simInit
.rndstr

Generate random strings
scheduleConditionalEvent

Schedule a conditional simulation event
restartSpades

Restart an interrupted simulation
savedSimEnv

Retrieve environment for saving interrupted simulations
saveSimList

Save a whole simList object to disk
.runModuleInputObjects

Run module's .inputObjects
simFile

Generate simulation file name
.simDeps-class

The .simDeps class
simInit

Initialize a new simulation
.sim2gantt

sim2gantt
.simInitMessageHandler

Calling handlers that prefix simInit-phase messages/warnings
envir

Simulation environment
simInitAndSpades2

simInitAndSpades2 is a convenience wrapper for do.call(simInitAndSpades, listOfArgs), i.e., a user can pass a list of all the arguments.
scheduleEvent

Schedule a simulation event
setPaths

Get and set default working directories
show,simList-method

Show an Object
events

Simulation event lists
times

Time usage in SpaDES
modules

Simulation modules and dependencies
inputs

Simulation inputs
inputObjects

Metadata accessors
newObjectsCreated

Show which objects were first created in a simInit or spades call
paths

Specify paths for modules, inputs, outputs, and temporary rasters
outputs

Simulation outputs
simList-class

The simList class
singularPlural

Pick the singular or plural form for a message
.unparsed

Determine which modules in a list are unparsed
dhour

SpaDES time units
suppliedElsewhere

Assess whether an object has or will be supplied from elsewhere
spades2

spades2 is a convenience wrapper for do.call(spades, listOfArgs), i.e., a user can pass a list of all the arguments.
spadesOptions

SpaDES.core options
[,simList,character,ANY-method

Extract an intact simList but with subset of objects
.tagsByClass,simList-method

.tagsByClass for simList objects
inSeconds

Convert time units
.tryCatch

tryCatch that keeps warnings, errors and value (result)
spadesClasses

Classes defined in SpaDES
updateList

Update elements of a named list with elements of a second named list
zipModule

Create a zip archive of a module subdirectory
.verb

Chose verb conjugation for "to be"
writeEventInfo

Write simulation event info to file
writeRNGInfo

Write RNG state info to file
use_gha

Use GitHub actions for automated module checking