Learn R Programming

SpaDES.tools

Additional modelling tools for Spatial Discrete Event Simulation (SpaDES) module development.

Provides GIS/map utilities and additional modeling tools for developing cellular automata and agent based models in SpaDES.

Website: https://SpaDES.PredictiveEcology.org

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

Installation

Building packages from source requires the appropriate development libraries for your operating system (e.g., Windows users should install Rtools).

Current stable release

Install from CRAN:

install.packages("SpaDES.tools")

Install from GitHub:

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

Development version (unstable)

Install from GitHub:

#install.packages("devtools")
library("devtools")
install_github("PredictiveEcology/SpaDES.tools", 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.tools')

Monthly Downloads

735

Version

2.1.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Alex M Chubaty

Last Published

January 11th, 2026

Functions in SpaDES.tools (2.1.1)

directionFromEachPoint

Calculate distances and directions between many points and many grid cells
randomStudyArea

Create default study areas for use with SpaDES modules
runifC

Rcpp Sugar version of runif
rasterizeReduced

Convert reduced representation to full raster
resample

middlePixel

Return the (approximate) middle pixel on a raster
.matchedPointDirection

Calculate matched point directions
neutralLandscapeMap

Produce a neutral landscape using a midpoint displacement algorithm
randomPolygons

Produce a SpatRaster of random polygons
patchSize

Patch size
.pkgEnv

The SpaDES.tools package environment
rings

Identifies all cells within a ring around the focal cells
spread2

Simulate a contagious spread process on a landscape, with data.table internals
rbindlistDtDtpot

Internal helpers
specificNumPerPatch

Initiate a specific number of agents in a map of patches
spread3

An alternative spread function, conceived for insects
spokes

Identify outward radiating spokes from initial points
mergeRaster

Split and re-merge RasterLayer(s)
spread

Simulate a spread process on a landscape.
testEquivalentMetadata

Test that metadata of 2 or more objects is the same
sampleV

Resample
wrap

Wrap coordinates or pixels in a torus-like fashion
fastCrop

fastCrop is deprecated.
cirSpecialQuick

This is a very fast version of cir with allowOverlap = TRUE, allowDuplicates = FALSE, returnIndices = TRUE, returnDistances = TRUE, and includeBehavior = "excludePixels". It is used inside spread2, when asymmetry is active. The basic algorithm is to run cir just once, then add to the x,y coordinates of every locus.
SpaDES.tools-package

Categorized overview of the SpaDES.tools package
probInit

SELES - Probability of Initiation
transitions

SELES - Transitioning to next time step
adj

Fast adjacent function, and Just In Time compiled version
move

Move
agentLocation

SELES - Agent Location at initiation
cir

Identify pixels in a circle or ring (doughnut) around an object.
numAgents

SELES - Number of Agents to initiate
inRange

Test whether a number lies within range [a,b]
initiateAgents

SELES - Initiate agents
heading

Heading between spatial points.
distanceFromEachPoint

Calculate distances and directions between many points and many grid cells
dwrpnorm2

Vectorized wrapped normal density function
duplicatedInt

Rcpp duplicated on integers using Rcpp Sugar
gaussMap

Produce a raster of a random Gaussian process.
.findFactors

Find factors
.pointDistance

Alternative point distance (and direction) calculations