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

901

Version

2.0.8

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Alex M Chubaty

Last Published

October 11th, 2025

Functions in SpaDES.tools (2.0.8)

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.
heading

Heading between spatial points.
directionFromEachPoint

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

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

Produce a raster of a random Gaussian process.
initiateAgents

SELES - Initiate agents
distanceFromEachPoint

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

Rcpp duplicated on integers using Rcpp Sugar
.pointDistance

Alternative point distance (and direction) calculations
patchSize

Patch size
.pkgEnv

The SpaDES.tools package environment
randomPolygons

Produce a SpatRaster of random polygons
middlePixel

Return the (approximate) middle pixel on a raster
neutralLandscapeMap

Produce a neutral landscape using a midpoint displacement algorithm
runifC

Rcpp Sugar version of runif
resample

.matchedPointDirection

Calculate matched point directions
dwrpnorm2

Vectorized wrapped normal density function
randomStudyArea

Create default study areas for use with SpaDES modules
rasterizeReduced

Convert reduced representation to full raster
.findFactors

Find factors
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.
wrap

Wrap coordinates or pixels in a torus-like fashion
testEquivalentMetadata

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

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

Internal helpers
rings

Identifies all cells within a ring around the focal cells
sampleV

Resample
agentLocation

SELES - Agent Location at initiation
move

Move
transitions

SELES - Transitioning to next time step
SpaDES.tools-package

Categorized overview of the SpaDES.tools package
adj

Fast adjacent function, and Just In Time compiled version
probInit

SELES - Probability of Initiation
cir

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

fastCrop is deprecated.
numAgents

SELES - Number of Agents to initiate