Learn R Programming

⚠️There's a newer version (2.0.5) of this package.Take me there.

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) doi:10.1111/ele.13994, Barros et al. (2022) doi: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. The suggested package 'NLMR' can be installed from the repository (https://PredictiveEcology.r-universe.dev).

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

841

Version

2.0.3

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Eliot J B

Last Published

November 10th, 2023

Functions in SpaDES.core (2.0.3)

.addTagsToOutput,simList-method

.addTagsToOutput for simList objects
Plots

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

.addChangedAttr for simList objects
SpaDES.core-package

Categorized overview of the SpaDES.core package
Plot,simList-method

Plot method for simList objects
append_attr

Add a module to a moduleList
Copy,simList-method

Copy for simList class objects
bindrows

Simple wrapper around data.table::rbindlist
.checkCacheRepo,list-method

.checkCacheRepo for simList objects
checksums

Calculate checksum for a module's data files
checkParams

Check use and existence of parameters passed to simulation.
citation

A citation method for SpaDES modules
.cacheMessage,simList-method

.cacheMessage for simList objects
checkpointFile

Simulation checkpoints.
checkObject

Check for existence of object(s) referenced by a objects slot of a simList object
checkModuleLocal

Check for the existence of a module locally
checkModule

Check for the existence of a remote module
convertToPackage

Convert standard module code into an R package
defineParameter

Define a parameter used in a module
defineModule

Define a new module.
copyModule

Create a copy of an existing module
defineEvent

Alternative way to define events in SpaDES.core
.wrap.simList

Methods for .wrap and .unwrap
classFilter

Filter objects by class
createsOutput

Define an output object of a module
depsGraph

Build a module dependency graph
.findObjects

Find objects if passed as character strings
depsEdgeList

Build edge list for module dependency graph
clearCache,simList-method

clearCache for simList objects
zipSimList

Zip a simList and various files
.fileEdit

Open a file for editing
doEvent

Process a simulation event
.depsPruneEdges

Prune edges to remove cycles in module dependencies
.depsLoadOrder

Determine module load order
.cleanPkgs

strip GitHub repo info from vector of packages
.coreModules

Named list of core SpaDES modules
.fileTableIn

Create empty fileTable for inputs and outputs
eventDiagram

Simulation event diagram
expectsInput

Define an input object that the module expects.
.fillInputRows

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

Default (empty) metadata
.fillOutputRows

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

Extract filename (without extension) of a file
.findElementsInEnv

Find all references to sim$
loadSimList

Load a saved simList and ancillary files
makeMemoisable.simList

Make simList correctly work with memoise
moduleMetadata

Parse and extract module metadata
moduleParams

Extract a module's parameters, inputs, or outputs
initialize,simList-method

Generate a simList object
moduleDiagram

Simulation module dependency diagram
getModuleVersion

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

A slightly modified version of getOption()
.identifyChildModules

Identify child modules from a recursive list
.findSimList

Find simList in a nested list
extractURL

Extract a url from module metadata
moduleGraph

Build a module dependency graph
.findModuleName

Identify module names up to a given recursive level
.keepAttrs

Attach missing attributes from x to y
downloadData

Download module data
.guessPkgFun

Guess package of a function
downloadModule

Download a module from a SpaDES module GitHub repository
emptyEventList

Blank (template) event list
ganttStatus

ganttStatus
.getModuleInputObjects

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

Get copies of sample files for examples and tests
minTimeunit

Determine the smallest timeunit in a simulation
params

Get and set simulation parameters
newProjectCode

Create new module code file
paramCheckOtherMods

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

Create template testing structures for new modules
newModuleDocumentation

Create new module documentation
newProject

Create new SpaDES project
.modifySearchPath

Modify package order in search path
.parseElems,simList-method

.parseElems for simList class objects
.fileExtensions

File extensions map
moduleCodeFiles

Extract the full file paths for R source code
moduleCoverage

Calculate module coverage of unit tests
moduleVersion

Parse and extract a module's version
.callingModuleName

Namespacing within SpaDES
openModules

Open all modules nested within a base directory
objSize.simList

Object size for simList
.isNamespaced

Check is module uses module namespacing
objectDiagram

Simulation object dependency diagram
._inputObjectsDF

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

Extract or replace an object from the simulation environment
objectSynonyms

Identify synonyms in a simList
.parseModulePartial

Parse and initialize a module
packages

Get module or simulation package dependencies
.parseMessage

Prepend module name to a message
rasterToMemory

Read raster to memory
rasterCreate

Simple wrapper to load any Raster* object
scheduleConditionalEvent

Schedule a conditional simulation event
.moduleDeps-class

The .moduleDeps class
scheduleEvent

Schedule a simulation event
memoryUseThisSession

Estimate memory used with system("ps")
globals

Get and set global simulation parameters
maxTimeunit

Determine the largest timestep unit in a simulation
newModule

Create new module from template
newModuleCode

Create new module code file
saveFiles

Save objects using .saveObjects in params slot of simInit
saveSimList

Save a whole simList object to disk
moduleDefaults

Defaults values used in defineModule
newProgressBar

Progress bar
.robustDigest,simList-method

.robustDigest for simList objects
rndstr

Generate random strings
events

Simulation event lists
inputs

Simulation inputs
.quickCheck

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

Event priority
.preDigestByClass,simList-method

Pre-digesting method for simList
.pkgEnv

The SpaDES.core package environment
restartSpades

Restart an interrupted simulation
simInitAndSpades

Call simInit and spades together
envir

Simulation environment
.prepareOutput,simList-method

.prepareOutput for simList objects
restartR

Restart R programmatically
setPaths

Get and set default working directories
reexports

Objects exported from other packages
remoteFileSize

Determine the size of a remotely hosted file
progressInterval

Get and set simulation progress bar details
.runCodeChecks

Runs a series of code checks during simInit()
simInit

Initialize a new simulation
.runModuleInputObjects

Run module's .inputObjects
simFile

Generate simulation file name
spadesClasses

Classes defined in SpaDES
show,simList-method

Show an Object
spades

Run a spatial discrete event simulation
.simDeps-class

The .simDeps class
simList-class

The simList class
times

Time usage in SpaDES
.sim2gantt

sim2gantt
writeEventInfo

Write simulation event info to file
spadesOptions

SpaDES.core options
dhour

SpaDES time units
.verb

Chose verb conjugation for "to be"
.tryCatch

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

Simulation outputs
paths

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

Determine which modules in a list are unparsed
inputObjects

Metadata accessors
modules

Simulation modules and dependencies
updateList

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

Use GitHub actions for automated module checking
[,simList,character,ANY-method

Extract an intact simList but with subset of objects
suppliedElsewhere

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

Convert time units
writeRNGInfo

Write RNG state info to file
zipModule

Create a zip archive of a module subdirectory
.tagsByClass,simList-method

.tagsByClass for simList objects
.addDepends

Add simulation dependencies
anyPlotting

Test whether there should be any plotting from .plots module parameter
all.equal.simList

All equal method for simList objects